ASP.NET 4 Web Server Here Shell Extension

asp.net 0 comments suggest edit

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.

Found a typo or error? Suggest an edit! If accepted, your contribution is listed automatically here.

Comments

avatar

15 responses

  1. Avatar for Lee Englestone
    Lee Englestone October 27th, 2009

    Home come I never knew about this Shell extension!?
    It sounds very useful indeed.
    -- Lee

  2. Avatar for Andrey
    Andrey October 27th, 2009

    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.

  3. Avatar for Diogo Edegar Mafra
    Diogo Edegar Mafra October 27th, 2009

    Great tip! I do it a lot.

  4. Avatar for Jorge
    Jorge October 27th, 2009

    Very helpful. And I missed it when you first wrote it! Thanks Phil.

  5. Avatar for Satu
    Satu October 27th, 2009

    Thanks for the zip.

  6. Avatar for Michael Sanford
    Michael Sanford October 27th, 2009

    Very cool trick. Now what's up with that "Delete SVN Folders" shell extension? THAT looks like a huge timesaver! More details please! :)

  7. Avatar for Peter.O
    Peter.O October 27th, 2009

    +1 to that BTW observation by Michael. That "Delete SVN Folders" must be cuter that the current TortoiseSVN "Export" function.

  8. Avatar for Paul
    Paul October 28th, 2009

    what would be even cooler is if you could point it at the Zip file without needing to extract it first

  9. Avatar for Haacked
    Haacked October 28th, 2009

    @Michael @Peter your wish is my command. :) Jon Galloway wrote this extension a long while ago.

  10. Avatar for Ricardo
    Ricardo October 28th, 2009

    Thanks! this is very useful.

  11. Avatar for Dimitry Tech
    Dimitry Tech October 28th, 2009

    when is the release date for .net 4.0?

  12. Avatar for AlexB
    AlexB October 28th, 2009

    Combine it with a small vb script to dynamically assign ports and you can run multiple instances of a web server with different apps

  13. Avatar for Visual C# Kicks
    Visual C# Kicks October 29th, 2009

    Thanks this is great

  14. Avatar for Scott Isaacs
    Scott Isaacs July 31st, 2010

    FWIW, download links don't work (on the 2008 version either). Fortunately I can copy/paste the contents of the REG files. :)

  15. Avatar for NTWebs
    NTWebs February 10th, 2011

    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.