简体   繁体   English

无需重启即可清除 ASP.NET 临时组件 IIS

[英]Clear ASP.NET Temporary Assemblies Without Restarting IIS

I moved some code OUT of the App_Code folder and now I'm getting the classic conflict issue between the code I'm compiling in my project and the EXISTING temporary compiled assemblies in the temporary cache.我将一些代码移出 App_Code 文件夹,现在我遇到了我在项目中编译的代码与临时缓存中现有的临时编译程序集之间的经典冲突问题。 I know I can just delete the temporary assemblies, but I this requires stopping IIS.我知道我可以删除临时程序集,但这需要停止 IIS。 I will need to do this in my deployment strategy all the way up to our production environment and don't want to restart IIS.我需要在我的部署策略中一直执行此操作,直到我们的生产环境,并且不想重新启动 IIS。 Is there a way to do this?有没有办法做到这一点?

Can you try你能试一下吗

  1. stop your website (not iis)停止您的网站(不是 iis)
  2. try deleting the temporary files尝试删除临时文件

second option could be (risky) 1. kill asp.net worker process (this is the criminal locking out the files in temp folder) 2. try deleting the temp files.第二个选项可能是(有风险的) 1. 杀死 asp.net 工作进程(这是锁定临时文件夹中文件的犯罪分子) 2. 尝试删除临时文件。

its difficult to recognize what process is actually locking out the files, if its running in a not ISAPI environment, ie a wp exe file, you can use some file monitoring tools to find out the process id which is accessing/locking the file, then use task manager to kill it.很难识别是哪个进程实际锁定了文件,如果它运行在非 ISAPI 环境中,即 wp exe 文件,您可以使用一些文件监控工具找出正在访问/锁定文件的进程 ID,然后使用任务管理器杀死它。

cheers.干杯。

Try making a small change to the web.config file like maybe set up a setting who's sole purpose is to be changed, and then save.尝试对 web.config 文件进行一些小的更改,例如设置一个唯一目的是更改的设置,然后保存。 If the web.config is change it will force the site to re-compile and restart the process.如果 web.config 发生更改,它将强制站点重新编译并重新启动该过程。 This is also a way to clear out cached data.这也是一种清除缓存数据的方法。 I am not sure if just saving the web.config file to update the modified date is enough.我不确定仅保存 web.config 文件以更新修改日期是否足够。 I usually just change a value or something.我通常只是改变一个值或其他东西。 I have never tried to automate it, but it would be possible I think.我从未尝试过自动化它,但我认为这是可能的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM