|
ERROR: The directory does not exist or is not accessible because of security settings |
|
Setting up web virtual directories in locations like \My Documents\My Visual Studio Project\ProjectX can result in an errormessage like the ones below.... This is due to the fact that ASP.NET needs to be able to inspect for things like the web.config file... In my experience this is a permissions issue... Logic would dictate that you need to go give your asp.net user account access to the folder... The key is that in Windows 2003 and Longhorn, this account is named "NETWORK SERVICE" (Sometimes we forget this =)
Server cannot access application directory 'C:\Inetpub\wwwroot\ASPNET Testing\'. The directory does not exist or is not accessible because of security settings.
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: Server cannot access application directory 'C:\Inetpub\wwwroot\ASPNET Testing\'. The directory does not exist or is not accessible because of security settings.
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 (0x80004005): Server cannot access application directory 'C:\Inetpub\wwwroot\ASPNET Testing\'. The directory does not exist or is not accessible because of security settings.]
System.Web.HttpRuntime.EnsureAccessToApplicationDirectory() +72
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +263
[HttpException (0x80004005): ASP.NET Initialization Error]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +983
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +128
OR this:
Access denied to 'c:\inetpub\wwwroot\'. 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\'. 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\'. Failed to start monitoring file changes.]
System.Web.DirMonCompletion..ctor(DirectoryMonitor dirMon, String dir, Boolean watchSubtree, UInt32 notifyFilter) +139
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) +331
[HttpException (0x80004005): ASP.NET Initialization Error]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +983
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +128