Article ID: 317955 - Last Review: July 8, 2005 - Revision: 4.4 FIX: "Failed to start monitoring directory changes" error message when you browse to an ASP.NET page
This article was previously published under Q317955 On This PageSYMPTOMS
When you browse to an ASP.NET (.aspx) page, you may receive one of the following error messages:
Access denied to 'D:\MyWeb\Users\MainDirectory\MyApplication\' directory. Failed to start monitoring directory changes.
-or-
Access denied to 'D:\MyWeb\Users\MainDirectory\MyApplication\SamplePage.aspx'. Failed to start monitoring file changes.
CAUSE
To detect file changes, the process identity and the impersonated user identity must have specific permissions to all of the directories in the hierarchy of the file path for the file that ASP.NET is monitoring if any of the directories in that hierarchy have more than eight characters in their names. Some examples of the files that ASP.NET monitors are as follows:
You receive the second error message if the impersonated account does not have permissions on at least one of the directories in the hierarchy of that file path. RESOLUTION
Use either of the following methods to resolve this problem.
Method 1Make sure that all of the directory names in the hierarchy of that file path are less than nine characters long.For example:
C:\Web\Users\MainDir\Site1
Note If you rename the directories so that the length of each directory name is now fewer than nine characters, after you make the required changes in the configuration of the Web site in Microsoft Internet Information Services (IIS) to deal with the directory renaming, you have to restart IIS.Method 2Grant the required permissions on all of the directories in that hierarchy to the ASP.NET process account (ASPNET by default) or to the impersonated account (if impersonation is turned on). To do this, follow these steps:
Method 3If your computer is running IIS 6.0, grant the required permissions on all the folders in that hierarchy to the Network Service account. To do this, follow these steps:
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
This bug was corrected in ASP.NET (included with the .NET Framework) 1.1.
MORE INFORMATION
This is the call stack trace that is associated with the first error message in the "Symptoms" section:
[HttpException (0x80004005): Access denied to 'D:\MyWeb\Users\MainDirectory\MyApplication\' directory. Failed to start monitoring directory changes.] System.Web.FileChangesMonitor.StartMonitoringDirectoryRenamesAndBinDirectory(String dir, FileChangeEventHandler callback) System.Web.HttpRuntime.StartMonitoringDirectoryRenamesAndBinDirectory() System.Web.HttpRuntime.FirstRequestInit(HttpContext context) [HttpException (0x80004005): ASP.NET Initialization Error] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) [HttpException (0x80004005): Access denied to 'D:\MyWeb\Users\MainDirectory\MyApplication\SamplePage.aspx'. Failed to start monitoring file changes.] System.Web.FileChangesMonitor.StartMonitoringFile(String fileName, FileChangeEventHandler callback) System.Web.Caching.CacheDependency.Init(String[] filenames, String[] cachekeys, CacheDependency dependency, DateTime start) System.Web.Caching.CacheDependency..ctor(String filename, DateTime start) System.Web.Caching.CacheDependency..ctor(String filename) System.Web.Security.FileAuthorizationModule.OnEnter(Object source, EventArgs eventArgs) System.Web.SyncEventExecutionStep.Execute() System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) REFERENCES
For additional information about the same error message in a different scenario, click the following article number to view the article in the Microsoft Knowledge Base:
316721
(http://support.microsoft.com/kb/316721/
)
"Failed to start monitoring directory changes" error message when you browse to ASP.NET page
For additional information about the permissions that the ASPNET account requires to run your ASP.NET applications, click the following article number to view the article in the Microsoft Knowledge Base:
317012
(http://support.microsoft.com/kb/317012/
)
Process and request identity in ASP.NET
For additional information about ASP.NET security, click the following article number to view the article in the Microsoft Knowledge Base:
306590
(http://support.microsoft.com/kb/306590/
)
ASP.NET security overview
| Other Resources Other Support Sites
CommunityGet Help NowArticle Translations
|






















Back to the top