Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to start monitoring changes on global.asax .net 3.5 Web service using Impersonation

I am trying to use impersonation in a an asp.net 3.5 webservice. However whenever I try to run the service with Impersonation enabled (In web.config) I am receiving the following error in my Windows Event log:

Exception message: Failed to start monitoring changes to 'C:\1work\temp\NotificationWatcherWebServiceClean2010\NotificationWatcherWebService\NotificationWatcherWebService\global.asax'

I initially didn't even have a global.asax so I tried adding 1 and adding explicit permissions for the user I'm trying to impersonate.

I am using the following environment.
Visual Studio 2010
Windows 7 64-bit
.Net Framework 3.5

Any ideas?

like image 469
Fishcake Avatar asked Feb 03 '11 17:02

Fishcake


2 Answers

I've seen this issue each time I get a new box, or have mine reimaged. What I have to do is grant the account that is being impersonated (assuming it's a single account, otherwise you may need to grant a group of users) access to key folders.

Specifically C:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files but also you might try c:\windows\temp and your own user temp folder located at C:\Users\userid\AppData\Local\Temp.

like image 165
Peter Avatar answered Oct 16 '22 19:10

Peter


It seems this error is a result of the impersonated user account not being a member of the IIS_IUSRS group. Adding membership to this group in Control Panel / Administrative Tools / Computer Management / Local Users and Groups should help to resolve the problem.

like image 3
Michael Avatar answered Oct 16 '22 18:10

Michael