简体   繁体   English

如何在不停止调试的情况下回收IIS Express?

[英]How to recycle IIS Express without stop Debugging?

I came across with a problem related to recycling the iis and statics variables (more specifically: dictionaries) problems in which the statics Dictionaries lose their values ​​and keys when the pool is recycled. 我遇到了一个与回收iis和静态变量(更具体地说是字典)相关的问题,其中静态字典在池被回收时丢失了它们的值和键。

But this problem can only simulate in the production ambient. 但是这个问题只能在生产环境中模拟。 In development I can't simule :( 在开发中我不能模拟:(

I had the idea of ​​using IIS Express to simulate debugging the problem, but to do this I need to recycle the IIS Express without stopping to debug. 我有想法使用IIS Express来模拟调试问题,但要做到这一点,我需要回收IIS Express而不停止调试。

Is there a way to do this? 有没有办法做到这一点? If not, does anyone have any idea how I can simulate this problem to fix it? 如果没有,有没有人知道如何模拟这个问题来解决它?

The apppool will recycle if you modify your App\\Web.config. 如果您修改App \\ Web.config,apppool将回收。 Unfortunately you'll have to do it via explorer/notepad, as Visual Studio will tell you to stop debugging if you try. 不幸的是你必须通过explorer / notepad来完成,因为Visual Studio会告诉你如果你尝试就停止调试。

My understanding is that this is not possible. 我的理解是这是不可能的。 Part of the point of recycling is to stop and start the process, which breaks the debugger attachment. 回收的一部分是停止并启动该过程,这会破坏调试器附件。

In terms of solving your static variables issue, consider perpetuating this type of data to an external store like Redis. 在解决静态变量问题方面,请考虑将此类数据永久保存到Redis等外部存储中。 It's a great way to preserve data that has to live across app pool recycles and is extremely fast and stable. 这是一种很好的方法来保存必须在应用程序池循环中生存的数据,并且非常快速和稳定。

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

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