Run the ASP.NET 2.0 Development Server From Any Folder

As I blogged about yesterday, I came up with a way to start up the web server that comes with Visual Studio 2005 by right-clicking on the folder you want to serve. Chris Frazier left some great feedback, along with Daniel Fisher.

I think I've solved all the problems that were involved, and there were a few. Besides what I initially talked about, Chris' wrapper solution didn't use the proper virtual path, due to an error in spacing. Daniel's solution went the StringBuilder route for setting up the executable's arguments, which took too much memory. I went the String.Format route, which accomplished the same thing with a lot less code.

I put together an installer that checks for the existence of the webserver executable, copies the wrapper to the .NET runtime directory, and adds the proper registry keys for both Admins and Non-Admins. I've tested it, and it does exactly what I need it to do. Let me know if anyone runs into any problems.

1 Comment

Comments have been disabled for this content.