Saturday, March 5, 2011

Failed to start monitoring changes to 'path' because access is denied.

Problem:
Brought up a web page and was presented with this error:

Server Error in '/' Application.


Failed to start monitoring changes to 'C:\Users\xxxx\AppData\Local\Temp\Temporary ASP.NET Files\root\b6230deb\7677a327\hash\hash.web' because access is denied.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Web.HttpException: Failed to start monitoring changes to 'C:\Users\xxxx\AppData\Local\Temp\Temporary ASP.NET Files\root\b6230deb\7677a327\hash\hash.web' because access is denied.

Source Error: 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 
 
[HttpException (0x80070005): Failed to start monitoring changes to 'C:\Users\xxxx\AppData\Local\Temp\Temporary ASP.NET Files\root\b6230deb\7677a327\hash\hash.web' because access is denied.]
   System.Web.DirectoryMonitor.AddFileMonitor(String file) +8805891
   System.Web.DirectoryMonitor.StartMonitoringFileWithAssert(String file, FileChangeEventHandler callback, String alias) +94
   System.Web.FileChangesMonitor.StartMonitoringFile(String alias, FileChangeEventHandler callback) +340
   System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate2(StandardDiskBuildResultCache diskCache) +790
   System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate(StandardDiskBuildResultCache diskCache) +55
   System.Web.Compilation.BuildManager.RegularAppRuntimeModeInitialize() +174
   System.Web.Compilation.BuildManager.Initialize() +261
   System.Web.Compilation.BuildManager.InitializeBuildManager() +246
   System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +350
 
[HttpException (0x80004005): Failed to start monitoring changes to 'C:\Users\xxxx\AppData\Local\Temp\Temporary ASP.NET Files\root\b6230deb\7677a327\hash\hash.web' because access is denied.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8950644
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +258



Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1


Solution:
First, I had to close Visual Studio 2010, then I deleted c:\Users\xxxx\AppData\ocal\Temp\Temporary ASP.NET Files.
Reopened Visual Studio and ran it again in debug mode, worked fine.

1 comment: