Latish Sehgal's Blog

KillCassini: A Visual Studio Extension to Kill Asp.Net Web Development Server

Update: Support for Visual Studio 2012 now added. Details here.

I am a big fan of minimizing mouse usage and relying on keyboard shortcuts. I find it to be more efficient in general and healthy for my wrists. If you work with Asp.Net and use the Asp.Net Web Development server on your local box, you would have noticed that you need to stop the server in order for the cache to clear and Application level events to fire again. And right now, you have to do this using a mouse.

I have had a Visual Studio macro for a long time that kills all the instances of the local Asp.Net Development Server, but in the interest of sharing it more easily with my peers, and to play around with Visual Studio 2010 extensibility, I have written a Visual Studio extension that allows you to do the same. You can get the extension here. If you want to play around with the code or change something, you can access the code on GitHub. Once you download the extension and install it, it’ll show up under your Tools Menu in Visual Studio.

You can change your keybinding by going under Tools->Options->Keyboard and searching for KillCassini.

And that’s it. You can invoke the extension by using the Tools Menu or your keyboard shortcut. If you are interested in what the extension is doing, it writes down some information in the Debug Output Window every time you run it.

One of the problems I used to face with my Visual Studio Macro for doing the same was that the orphaned icon for the killed server process used to stay around till you hovered your mouse over it. This is not a problem for most people (unless your OCD runs as deep as me). In this extension, I have made an attempt to rectify that problem by refreshing the Taskbar System tray. This seems to work on my system at least (64 bit Windows 7).

It has been fun playing with the Visual Studio extensibility and I hope to work on some more extensions in the near future.