简体   繁体   中英

Can I disable loaduserprofile in IIS Express?

In our production environment web applications are hosted on a IIS. Pool applications run under generic profile with loaduserprofile=false. (I guess) this is why I got an access denied when I try to access System.Diagnostics.EventLog.

When I debug the solution in VS 2017 it is hosted in IIS Express and no error is thrown when accessing System.Diagnostics.EventLog.

Can I disable loaduserprofile in IIS Express so that it behaves like the full IIS ?
Does it even make sense ?
Or does IIS Express always run with the profile that launches it in VS ?

Visual studio run under your default account which has permission to access all the things iis application or site run under the application pool identity which uses iis user like iusr or iis_iusrs which does not have access to use all the things. that's why you get access denied error message. if you want to change the application pool identity you could select your appropriate application pool and set by using the advanced setting. local system and network service have enough access in application pool identity

在此处输入图片说明 .

If you want to set load user profile false then you could modify the applicationhost.config file directly to add/manage application pools. To setup enable loading the user profile, you would modify the line related to your application pool and add the below line to it within the XML elements.:

<processModel loadUserProfile="true" />

You could refer below link for more detail:

What exactly happens when I set LoadUserProfile of IIS pool?

loadUserProfile and IIS7 - understanding temporary directory failures

Access denied when reading system event log entries on ASP.NET web application hosted on IIS 8

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM