SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software
ASP.NET, VB.NET, Microsoft .NET Framework, Microsoft Visual Studio, Windows Forms, Controls and more Tutorials and Articles for Programmers


Failed to start monitoring file changes


Recently, I set up a virtual directory for an ASP.NET File Upload application.

The application was a sample application zipped in a .zip file. I extracted the application to a folder. Then I pointed the folder where the source files are located as the Local Path of the virtual directory that I have defined by the IIS manager. The ASP.NET version property of the virtual directory was originally set to 1.1.4322 on the Properties screen of the directory which I have opened by using the IIS management console.

When I browsed the fiel upload application by calling the default URL of this web application, I got the following error message.





 

Server Error in '/FileUpload' Application.


 

Access denied to 'C:\Inetpub\wwwroot\FileUpload\'. Failed to start monitoring file changes.

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: Access denied to 'C:\Inetpub\wwwroot\FileUpload\'.
Failed to start monitoring file changes.

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): Access denied to 'C:\Inetpub\wwwroot\FileUpload\'. Failed to start monitoring file changes.]
System.Web.DirMonCompletion..ctor(DirectoryMonitor dirMon, String dir, Boolean watchSubtree, UInt32 notifyFilter) +140
System.Web.DirectoryMonitor.StartMonitoring() +42
System.Web.DirectoryMonitor.StartMonitoringFile(String file, FileChangeEventHandler callback, String alias) +154
System.Web.FileChangesMonitor.StartMonitoringDirectoryRenamesAndBinDirectory(String dir, FileChangeEventHandler callback) +278
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +332

[HttpException (0x80004005): ASP.NET Initialization Error]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +990
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +128

 
Version Information:  Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032

 

Just as similar to incident with "Failed to initialize the AppDomain" which I wrote about at Failed to initialize the AppDomain, the "Access denied to" exception make me think about the security permission on the application folder. I opened the root folder of the virtual site FileUpload and right click to open the context menu. Then select Properties from the menu and navigate to Security tab. I noticed that the ASP.NET Machine Account is not listed in the Group or user names area, add the ASP.NET user of the web server with read permissions.

After the read permissions are given to ASPNET user of the server, I can browse the site successfully.



Visual Studio


Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.