Visual Studio don't call Application_End on Debug
I implement some code in Application_Start and Application_End (global.asax). When i start ASP.NET Developer Server the Application_Start run normally. When i change the web.config file, the method Application_Start is called aga开发者_运维问答in but Application_End is never called.
Someone know how can i force Application_End run before the second call to Application_Start
Is Application_End not being called or is it that a break point in Application_End is not being hit?
Application_End is called when the application pool is stopped.
When you are debugging you are attached to the application pool process.
What may be happening is that the debugger looses contact with the application pool before the Application_End is called, and you are therefore not hitting the break point.
My code opens a server socket in Application_Start, so Visual Studio couldn´t restart my application whitout closing it. For safety VS don´t restart my Application.
VS calls Application_End only if he knows that noone is affected. In my case i could be using the socket to sending or receiving data.
精彩评论