ASP.NET 4 Web Server Here Shell Extension

Have you ever needed to quickly spawn a web server against a local folder to preview a web application? If not, what would you say you do here?

This is actually quite common for me since I receive a lot of zip files containing web applications which reproduce a bug. After I unzip the repro, I need a way to quickly point a web server at the folder and run the web site.

A while back I wrote about a useful registry hack to do just this. It adds a right click menu to start a web server (Cassini) pointing to any folder. This was based on a shell extension by Robert McLaws.

Well that was soooo 2008. It’s almost 2010 and Visual Studio 2010 Beta 2 is out which means it’s time to update this shell extension to run an ASP.NET 4 web server.

add-web-server-here

Obviously this is not rocket science as I merely copied my old settings and updated the paths. But if you’re too lazy to look up the new file paths, you can just copy these settings (changes are in bold).

32 bit (x86)

Windows Registry Editor Version 5.00
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\VS2010 WebServer]
@="ASP.NET 4 Web Server Here"
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\VS2010 WebServer\command]
@="C:\\Program Files\\Common Files\\microsoft shared\\DevServer
\\10.0\\Webdev.WebServer40.exe /port:8081 /path:\"%1\""

64 bit (x64)

Windows Registry Editor Version 5.00
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\VS2010 WebServer]
@="ASP.NET 4 Web Server Here"
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\VS2010 WebServer\command]
@="C:\\Program Files (x86)\\Common Files\\microsoft shared\\DevServer
\\10.0\\Webdev.WebServer40.exe /port:8081 /path:\"%1\""

I chose a different port and name for this shell extension so that it lives side-by-side with my other one.

Of course, I wouldn’t even bother trying to copy these settings from this blog post since I conveniently zipped up .reg files you can run.

What others have said

Requesting Gravatar... Lee Englestone Oct 27, 2009 5:25 PM
# re: ASP.NET 4 Web Server Here Shell Extension
Home come I never knew about this Shell extension!?
It sounds very useful indeed.

-- Lee
Requesting Gravatar... Andrey Oct 27, 2009 5:42 PM
# re: ASP.NET 4 Web Server Here Shell Extension
I usually run Visual Studio and open the folder as a web site. Anyway you need to launch VS to view source code of the web site.
Requesting Gravatar... Diogo Edegar Mafra Oct 27, 2009 7:05 PM
# re: ASP.NET 4 Web Server Here Shell Extension
Great tip! I do it a lot.
Requesting Gravatar... Jorge Oct 28, 2009 12:04 AM
# re: ASP.NET 4 Web Server Here Shell Extension
Very helpful. And I missed it when you first wrote it! Thanks Phil.
Requesting Gravatar... Satu Oct 28, 2009 1:01 AM
# re: ASP.NET 4 Web Server Here Shell Extension
Thanks for the zip.
Requesting Gravatar... Michael Sanford Oct 28, 2009 1:49 AM
# re: ASP.NET 4 Web Server Here Shell Extension
Very cool trick. Now what's up with that "Delete SVN Folders" shell extension? THAT looks like a huge timesaver! More details please! :)
Requesting Gravatar... Peter.O Oct 28, 2009 2:17 AM
# re: ASP.NET 4 Web Server Here Shell Extension
+1 to that BTW observation by Michael. That "Delete SVN Folders" must be cuter that the current TortoiseSVN "Export" function.
Requesting Gravatar... Paul Oct 28, 2009 7:29 AM
# re: ASP.NET 4 Web Server Here Shell Extension
what would be even cooler is if you could point it at the Zip file without needing to extract it first
Requesting Gravatar... Haacked Oct 28, 2009 8:23 AM
# re: ASP.NET 4 Web Server Here Shell Extension
@Michael @Peter your wish is my command. :) Jon Galloway wrote this extension a long while ago.
Requesting Gravatar... Ricardo Oct 28, 2009 10:26 AM
# re: ASP.NET 4 Web Server Here Shell Extension
Thanks! this is very useful.
Requesting Gravatar... Dimitry Tech Oct 28, 2009 12:09 PM
# re: ASP.NET 4 Web Server Here Shell Extension
when is the release date for .net 4.0?
Requesting Gravatar... AlexB Oct 28, 2009 4:18 PM
# re: ASP.NET 4 Web Server Here Shell Extension
Combine it with a small vb script to dynamically assign ports and you can run multiple instances of a web server with different apps
Requesting Gravatar... Visual C# Kicks Oct 29, 2009 4:05 AM
# re: ASP.NET 4 Web Server Here Shell Extension
Thanks this is great
Requesting Gravatar... Scott Isaacs Jul 31, 2010 12:59 PM
# re: ASP.NET 4 Web Server Here Shell Extension
FWIW, download links don't work (on the 2008 version either). Fortunately I can copy/paste the contents of the REG files. :)
Requesting Gravatar... NTWebs Feb 10, 2011 9:40 PM
# re: ASP.NET 4 Web Server Here Shell Extension
OMG this is brilliant, It gets so annoying when you have those zip files and you have to open your visual studio, this will save me time. Thanks very much for sharing.
Comments have been closed on this topic.