Clearing out "temporary asp.net files"
来源:互联网 发布:网络运营计划怎么写 编辑:程序博客网 时间:2024/06/13 01:08
When I am testing out issues with ASP.NET dynamic compilation and shadow copying, I frequently need to ensure the contents of the "temporary asp.net files" folder have been removed so that I get a clean and consistent repro each time.
Normally I just do an IISRESET /STOP, delete the files manually and then do an IISRESET /START.
But I got bored of that so thought I would try to automate it with a command file.
First thought was to do a DEL /S "C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/*.*"
This worked, but left the directory structure in place.
So my next thought was to do an RMDIR /S /Q "C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files" and then just recreate the directory.
That certainly left me with an empty directory, BUT, the "NETWORK SERVICE" account under which my application pools usually run had no permissions to the newly created folder, so I got an "access denied" error as soon as I tried to browse an ASP.NET page.
Then I thougt I'd get clever and use the built in command line tool CACLS.EXE to give full control permissions to the built in IIS_WPG local group of which NETWORK SERVICE is a paid up member. (Any account you use as the identity for an application pool should be added to IIS_WPG rather than trying to give the account all the needed permissions directly. It's much simpler and more maintainable.)
What I didn't like about that was that CACLS.EXE does not appear to support a way of suppressing the "are you sure (Y/N)?" prompts.
So finally I grabbed a copy of XCACLS.VBS and got the following command file working:
iisreset /stop
rmdir /q /s "C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files"
rmdir /q /s "C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files"
md "C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files"
md "C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files"
xcacls "C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files" /E /G MYMACHINE/IIS_WPG:F /Q
xcacls "C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files" /E /G MYMACHINE/IIS_WPG:F /Q
iisreset /start
- Clearing out "temporary asp.net files"
- Temporary ASP.Net Files探究
- 关于 Temporary ASP.NET Files 权限问题!!!
- 怎么删除Temporary ASP.NET Files
- Temporary ASP.NET Files提示没有权限
- cmd删除Temporary ASP.NET Files方法
- Temporary ASP.NET Files 文件夹中保存的是什么内容?
- Temporary ASP.NET Files 文件夹中保存的是什么内容?
- IIS Temporary ASP.NET Files拒绝访问解决方案
- IIS Temporary ASP.NET Files拒绝访问解决方案
- Temporary ASP.NET Files 文件夹中保存的是什么内容
- ASP.NET Temporary ASP.NET Files 缓存 想起的可恶BUG
- 未能找到元数据文件“C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/.......dll”
- 关于C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files的设置
- 未能写入输出文件“c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files
- C:\Windows\Microsoft.NET\Framework\v2.0.50727\ Temporary ASP.NET Files\root\...dll 拒绝访问
- CS0433: 类型同时存在于“c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\
- c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root
- apache 与 php配置文件
- 代理模式proxy (静态代理、动态代理)
- java连接mysql-2
- static关键字
- Log4j Property File Example
- Clearing out "temporary asp.net files"
- 新用户注册,新订单生成,在给客户发送邮件的同时,也给管理员发送邮件
- 塞班不死!ANNA翻身之作?还是坑爹无极限?
- Android NDK r5c 下载链接
- getSystemService
- 获取手机分辨率
- ipad,ihpone开发关于js与objetive -c交互
- Escape Rout
- ImageView 中的一些有用方法