Old application not stopped when rebuilding in VS

May 20, 2014 at 10:19 AM
The Microsoft web dev server properly shuts down the running web application when I rebuild the project in Visual Studio. I get Dispose and Application_End events of all instances and the AppDomain is unloaded. Also I see these events when terminating the dev server through the tray icon menu.

Cassini doesn't do any of this. Neither will it send any of the events, nor will it unload the AppDomain. I've set up a heartbeat timer that traces a line every 2 seconds to verify this. With Cassini the old instances keep beating, while with the Microsoft server they stop (because the AppDomain is unloaded).

This is causing severe trouble when an application does more than just serving requests, like background tasks or logging to an exclusive log file. Is this a known issue or did nobody ever use Cassini for more advanced things? Should I switch to IIS (Express) like newer VS versions do?

Using VS 2010 SP1 and Cassini x64 on Windows 7 SP1 x64.