Welcome to MSDN Blogs Sign in | Join | Help
Tip #21: Did you know...How to set a fixed port for the Developer Web Server?

When you create a file based web site, the "Developer Web Server" is fired up on a local port to serve the web site.  By default, the port value used is dynamic based on a pre-defined range and the availability of a port.  In some situations, you might want the web server to always use a fixed port value.

Here's how to do configure this:

  1. If the Properties window in Visual Studio is not already opened, open it with "F4" or via the toolbar - "View" -> "Properties Window".
  2. Left click on your web site in the "Solution Explorer" window.
  3. You'll now see a dialog similar to the following:

    CassiniDynamicPorts

    Notice the drop down list for the "Use dynamic ports" setting.  If you set this to "False", you'll then be able to specify a fixed port in the "Port number" field.  Set this to your desired port value.
  4. Launch your web site.  You'll see the port used matches the value you specified.

 
Mark Berryman
SDET, ASP.NET QA Team

Posted: Friday, November 07, 2008 11:39 PM by WebDevTools

Comments

Dan Kline said:

Your VS works differently from mine.  All I have is a Misc. Tab not a Developer Server Tab.  Am I missing something?

# November 8, 2008 1:23 AM

Mark Berryman said:

Any chance you created an IIS based web site instead of a file based web site?  The Developer Web Server is only used for file based web sites.

# November 10, 2008 10:21 AM

Visual Web Developer Team Blog said:

Latest on Tips and Tricks Blog. Tip #13: Did you know... How to get the browser agent using ASP.NET Ajax

# November 13, 2008 1:57 PM

ScottGu's Blog said:

I'm flying out later today on a pretty intense business trip (22,000 miles, 5 countries, 3 continents

# December 2, 2008 3:43 AM

BusinessRx Reading List said:

I'm flying out later today on a pretty intense business trip (22,000 miles, 5 countries, 3 continents,

# December 2, 2008 3:54 AM

Felix Wang | Evangelizing the Next Web said:

【原文地址】 Dec 2nd Links: ASP.NET, ASP.NET Dynamic Data, ASP.NET AJAX, ASP.NET MVC, Visual Studio, Silverlight/WPF

# December 2, 2008 9:35 PM

Steve Bohlen said:

@Dan:

This tip only applies to the 'file-based' web site project introduced in VS 2005.  If you are using a .csproj- or .vbproj-based 'Web Application Project' (the defaut in VS 2003, released as a hotfix to VS 2005 and then later made part of the VS 2005 SP1 release and also present from the get-go in VS 2008) then the steps are completely different:

1) Right-click on the project in the solution explorer, select properties

2) click on the 'Web' tab of the project properties page

3) Under the 'servers' section, select 'specific port' and enter the fixed port you want to use

The difference between what you have to do for a Web Site Project and a Web Application Project is because in the Web Site Project there isn't any .proj file to store your CASSINI dev webserver port settings.

HTH,

-Steve B.

# December 6, 2008 2:24 PM

Блог Скотта Гатри (перевод) said:

Сегодня я улетаю в очень насыщенную деловую поездку (22000 миль, 5 стран, 3 континента, 1 неделя, никакого

# May 20, 2009 1:43 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker