开发者

webapp hangs around in memory, WebDev.WebServer40.EXE not being torn down

I am running/debugging an asp.net mvc3 application from within Visual Studio 2010.

Anything static in nature is not called when I re-run the app from within Visual Studio.

(or even something simple like Application_Start())

Each time I want to run the webapp 'properly' I need to kill WebDev.WebServer40.EXE in the task manager before anything static is called again.

q1) Is this normal, and if Yes, why?

q2) If no, then I would expect the ASP.NET Development Server to be restarted each time I restart a debu开发者_Python百科gging session. How can I turn this on?

UPDATE: Recompiling sometimes causes Application_Start to be called, not always.

I've resorted to calling a batch file in the prebuild, eg

kill_WebServer40.bat

which contains

taskkill /F /IM WebDev.WebServer40.EXE
exit 0

If you embed those two commands directly into the pre-build textarea your compilation will fail if the WebServer isnt running already. This linked helped fix that.

Surprised this wasn't discussed more/previously - when developing an app, as if you have any static data/caches and you want to run the application 'clean' you would run into this issue.


Yes it's normal. It will restart if you touch the web.config or recompile. The development server continues to run the application in the background after you stop debugging.

You can stop the development server in the task tray by right clicking on the icon and choosing stop.

There isn't a way to force a application restart every time you hit debug. This would only be needed for the edge case where you are debugging application start up. Just hit rebuild before debugging and it will have the desired affect.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜