当前标识没有对“Temporary ASP.NET Files”目录的写访问权限

时间:2010-05-06 08:56:27

标签: asp.net

我一直在我的ASP.NET网络应用程序中收到此错误(如下)。我将网络服务帐户权限授予指定文件夹,它运行正常一段时间,但随后在一两天内再次出现错误,因为网络服务帐户已从文件夹的权限中删除。再次添加它会修复它,但为什么它会继续重复?

是否与使用Interop组件(如WMI)有关?

这是完整的错误:

Server Error in '/DriveMonitor' Application.
--------------------------------------------------------------------------------

The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'. 
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: The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'.

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): The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'.]
   System.Web.HttpRuntime.SetUpCodegenDirectory(CompilationSection compilationSection) +8918190
   System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags) +152

[HttpException (0x80004005): The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8890735
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259

2 个答案:

答案 0 :(得分:1)

您的计算机是否在域中?这可能是团体政策搞乱了。

在我的情况下,有安全指令禁用ASPNET帐户。

它导致了一般服务不可用错误,需要一段时间才能搞清楚。

答案 1 :(得分:1)

我还想查看服务器是否安装了思科安全代理(我认为这就是名称)。我们遇到了类似的问题,无论我们做了什么许可,我们都无法获得对阴影副本文件夹的网络服务访问权限,结果证明是思科安全代理拒绝访问该文件夹。