删除everyone对c:的 访问权限后,运行asp.net出现DirectoryNotFoundException未找到路径“C:\”的一部分
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.IO.DirectoryNotFoundException: 未找到路径“C:\”的一部分。
源错误:
执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。
堆栈跟踪:
[DirectoryNotFoundException: 未找到路径“C:\”的一部分。]
System.IO.__Error.WinIOError(Int32 errorCode, String str) +287
System.IO.Directory.InternalCreateDirectory(String fullPath, String path) +489
System.IO.Directory.CreateDirectory(String path) +195
System.Web.Compilation.PreservedAssemblyEntry.DoFirstTimeInit(HttpContext context) +85
[HttpException (0x80004005): 未能创建临时文件目录“C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root\12f3cdd9\118ba34”。访问被拒绝。]
System.Web.Compilation.PreservedAssemblyEntry.DoFirstTimeInit(HttpContext context) +143
System.Web.Compilation.PreservedAssemblyEntry.EnsureFirstTimeInit(HttpContext context) +97
System.Web.Compilation.PreservedAssemblyEntry.GetPreservedAssemblyEntry(HttpContext context, String virtualPath, Boolean fApplicationFile) +29
System.Web.UI.TemplateParser.GetParserCacheItemFromPreservedCompilation() +91
System.Web.UI.TemplateParser.GetParserCacheItemInternal(Boolean fCreateIfNotFound) +148
System.Web.UI.TemplateParser.GetParserCacheItemWithNewConfigPath() +125
System.Web.UI.TemplateParser.GetParserCacheItem() +88
System.Web.UI.ApplicationFileParser.GetCompiledApplicationType(String inputFile, HttpContext context, ApplicationFileParser& parser) +168
System.Web.HttpApplicationFactory.CompileApplication(HttpContext context) +43
System.Web.HttpApplicationFactory.Init(HttpContext context) +485
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +170
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +414
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:1.1.4322.573; ASP.NET 版本:1.1.4322.573
请参考:
http://msdn.microsoft.com/library/en-us/secmod/html/secmod15.asp
关键是最后一段:
Application Folder Hierarchy C:\ C:\inetpub\ C:\inetpub\wwwroot\ C:\inetpub\wwwroot\ mywebapp1 |
List Folder/ Read | Process | For file change notifications and the C# compiler (for file canonicalization reasons), the process account needs list folder and read data permissions to the application folder hierarchy. That is all parent folders all the way back |
往往可能忽略此设置。我就是因为删除了everyone对c:\的访问权限,结果导致iis运行asp.net出错,忙了半天才找到原因。