错误消息:“访问路径 c:\windows\microsoft.net\framework\(version)\Temporary ASP.NET Files\(blah) 被拒绝。” - 是什么原因造成的?
当我调试时,我经常会在 ASP.NET 错误页面上收到以下以漂亮的棕色文本显示的消息:
访问路径 “c:\windows\microsoft.net\framework\(版本)\Temporary ASP.NET Files\(blah)” 被拒绝。
我一直无法弄清楚是什么导致了它,什么真正解决了它,以及为什么会发生。
通常,“临时 ASP.NET 文件”部分(“(blah)”)后面的路径不存在,所以我不确定为什么它会在那里查找。
有时 IISRESET 可以修复它,有时则不能。
有时 aspnet_regiis 可以修复它,有时则不能。
有时重新启动可以修复它,有时则不能。
值得一提的是,我今天在使用一些 .NET 1.1 代码时遇到了这个问题(是的,仍在维护一些 - 希望尽快升级),并且我不确定我是否在 .NET 2.0 及更高版本中见过它。
有谁知道是什么原因导致这个问题以及应该如何解决它? 我认为它有多种可能的原因,但我只是好奇是否有人可以阐明它。
Every so often when I'm debugging, I get this message in nice brown text on an ASP.NET error page:
Access to the path
"c:\windows\microsoft.net\framework\(version)\Temporary ASP.NET Files\(blah)"
is denied.
I've never been able to figure out what causes it, what really fixes it, and why it happens.
Often times the path after the "Temporary ASP.NET Files" portion (the "(blah)") does not exist, so I'm not sure why it's looking there.
Sometimes an IISRESET fixes it, and sometimes it doesn't.
Sometimes an aspnet_regiis fixes it, and sometimes it doesn't.
Sometimes a reboot fixes it, and sometimes it doesn't.
For what it's worth I ran into this today with some .NET 1.1 code (yes, still maintaining some - hoping to upgrade it soon) and I'm not sure if I've ever seen it with .NET 2.0 and above.
Does anyone know what causes this and what should fix it? I assume it has multiple possible causes but I'm just curious if someone could shed some light on it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
据我了解,这可能是由于计算机上运行的防病毒软件间歇性锁定文件造成的。
It was my understanding this can be caused by anti-virus running on the machine and intermittently locking the files.
如果为临时目录打开 Windows 索引服务,则可能会发生这种情况。 有关详细信息,请参阅本文。 运行文件监视器(可从 sysinternals.com 获取)并在临时目录上放置过滤器。 当您收到访问错误时,请查看导致问题的应用程序。 这很可能是病毒扫描 - 从扫描中排除此目录并查看问题是否得到解决。
It could happen if the Windows indexing servicing is turned on for the temporary directory. See this article for details. Run File Monitor (available at sysinternals.com) and put a filter on the temporary directory. When you get the access error, see what application is causing the issue. It will most likely be the virus scan - exclude this directory from the scan and see if the problem is resolved.
默认情况下,ASP.NET 应用程序在 ASPNET 帐户 (IIS 5) 或 NETWORK_SERVICE 帐户 (IIS 6/7) 下运行。 如果您为网站启用了匿名功能,他们还会使用 IUSR_MACHINENAME 帐户。 授予这些帐户对您遇到访问问题的临时目录的完全权限。
By default, ASP.NET applications run under either the ASPNET account (IIS 5) or the NETWORK_SERVICE account (IIS 6/7). They also use the IUSR_MACHINENAME account if you have anonymous turned on for the site. Give these accounts full permissions to the temp directory you're having access problem with.
当 IIS 用户没有 \Temporary ASP.NET Files 目录的权限时,也可能会发生这种情况
This could also happen when the IIS user doesn't have permissions into the \Temporary ASP.NET Files directory
将用户“everyone”添加到临时 ASP.NET 文件文件夹的权限中
Add the user "everyone" to the permissions on the folder Temporary ASP.NET Files
我通过在运行进程监视器并过滤
Result is ACCESS DENIED
后向C:\Windows\Temp
上的组IIS_IUSRS
授予完全控制权解决了这个问题。csc.exe
试图在C:\Windows\Temp
中创建文件,但没有这样做的权限。I solved this by granting Full Control to the group
IIS_IUSRS
onC:\Windows\Temp
after running process monitor and filtering forResult is ACCESS DENIED
.csc.exe
was trying to create a file inC:\Windows\Temp
and did not have permission to do so.