Running ASP.NET Development Server Without Virtual Path, From Root#

I had been looking for a way to get the asp.net development server to run w/o a virtual directory settings.  It's really very stupid and short sighted to not enable this.  Just about every project I have ever worked on has some paths coded into the HTML that are based on / being the root, not the application root.  Stupid.

 

Anyway, ScottGu posted these steps on his site, and it works.  Not bad!

Step 1: Select the “Tools->External Tools” menu option in VS or Visual Web Developer.  This will allow you to configure and add new menu items to your Tools menu.

 

Step 2: Click the “Add” button to add a new external tool menu item.  Name it “WebServer on Port 8080” (or anything else you want).

 

Step 3: For the “Command” textbox setting enter this value: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\WebDev.WebServer.EXE (note: this points to the web-server that VS usually automatically runs).

 

Step 4: For the “Arguments” textbox setting enter this value: /port:8080 /path:$(ProjectDir)

 

Step 5: Select the “Use Output Window” checkbox (this will prevent the command-shell window from popping up.

 

 Once you hit apply and ok you will now have a new menu item in your “Tools” menu called “WebServer on Port 8080”.  You can now select any web project in your solution and then choose this menu option to launch a web-server that has a root site on port 8080 (or whatever other port you want) for the project.

 

You can then connect to this site in a browser by simply saying http://localhost:8080/.  All root based references will work fine.

 

Step 6: The last step is to configure your web project to automatically reference this web-server when you run or debug a site instead of launching the built-in web-server itself.  To-do this, select your web-project in the solution explorer, right click and select “property pages”.  Select the “start options” setting on the left, and under server change the radio button value from the default (which is use built-in webserver) to instead be “Use custom server”.  Then set the Base URL value to be: http://localhost:8080/

Categories: Code Links | ASP.Net | VS.Net
Wednesday, April 12, 2006 1:42:57 PM (Central Daylight Time, UTC-05:00) #    Comments [3]  | 

 

Wednesday, May 10, 2006 7:43:39 AM (Central Daylight Time, UTC-05:00)
Great! I had the same problem. Thanks a lot!
Alexey
Wednesday, March 19, 2008 6:26:35 AM (Central Standard Time, UTC-06:00)
Thanx a lot for a great solution. Just one little correction: "Arguments" textbox setting must be (on my system): /port:8080 /path:"$(ProjectDir)\"
Wednesday, June 10, 2009 10:28:32 AM (Central Daylight Time, UTC-05:00)
There's a simpler way to do this by tweaking the right textbox:
http://weblogs.asp.net/scottgu/archive/2006/12/19/tip-trick-how-to-run-a-root-site-with-the-local-web-server-using-vs-2005-sp1.aspx
Name
E-mail
(will show your gravatar icon)
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Live Comment Preview
All content © 2010, Christopher May, Inc
Open Job Positions
On this page
Google Ads
This site
Calendar
<April 2006>
SunMonTueWedThuFriSat
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456
Archives
Sitemap
Blogroll OPML
Disclaimer

Powered by: newtelligence dasBlog 2.3.9074.18820

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Send mail to the author(s) E-mail

Theme design by Jelle Druyts


Pick a theme: