拒绝临时ASP.NET文件频繁访问 [英] Frequent Access Denied to Temporary ASP.NET Files

查看:107
本文介绍了拒绝临时ASP.NET文件频繁访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从字面上看我运行一个大丑网站项目每第二次,我得到一个UnauthorizedAccessException,有消息指向一个DLL,例如临时ASP.NET文件\\ ctheweb \\ 0d76d363 \\ 4695c81f \\ App_Web_vi6bbbpy.dll'被拒绝。然后我停止和重新启动项目,运行良好。我做了一些测试,调试,修复,再运行它,并再次得到错误。

Literally every second time I run a big ugly web site project, I get an UnauthorizedAccessException, with a message pointing to a DLL, e.g. Temporary ASP.NET Files\ctheweb\0d76d363\4695c81f\App_Web_vi6bbbpy.dll' is denied. I then stop and restart the project, and it runs fine. I do some testing, debugging, fixing, run it again, and get the error again.

我倾向于到pre-build命令添加到刚刚明确表示目录,但我总是preFER解决一个问题比锤子等东西,至少在最初阶段。

I'm inclined to add a pre-build command to just clear that directory, but I always prefer to solve a problem with something other than a hammer, at least initially.

推荐答案

这发生了很大的发展过程中,当你不断地修改aspx页面,ASP.NET正试图编译和VS正试图编译和ASP.NET是试图执行的文件。此外,有时当你重置IIS锁定消失。

This happens a lot during development when you are constantly modifying the aspx pages, ASP.NET is trying to compile and VS is trying to compile and ASP.NET is trying to execute the files. Also, sometime the lock goes away when you reset IIS.

iisreset /stop
del "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\*.*"  /Q /F /S
del "C:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\*.*" /Q /F /S
iisreset /start

如果发生这种情况对生产再加入这个给你的web.config。

If this happens on production then add this to you web.config.

<compilation tempDirectory = "C:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\Other\" />

(滚动到一边,关键是要挑选一些\\其它\\文件夹不是默认的。

(scroll to the side, the key is to pick some \Other\ folder than the default.

最后,使用部署的项目,试图pre-编译事先做好准备。没有编译意味着没有企图取代Temp文件夹东西

And finally, use a Deployment project to try to pre-compile everything in advance. No compilation means no attempt to replace things in the temp folder

或者你可以尝试OS诊断,并试图找出进程在该文件上的锁,并杀死该进程。不值得时更容易解决办法是存在的努力。

Or you can try OS diagnostics and try to find out what process has a lock on that file and kill that process. Not worth the effort when easier solutions exist.

这篇关于拒绝临时ASP.NET文件频繁访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆