Udostępnij za pośrednictwem


Tip #21: Did you know...How to set a fixed port for the Developer Web Server?

Technorati Tags: Visual Studio 2008,VS2008,VWD,tips and tricks,Visual Studio,Cassini,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

Comments

  • Anonymous
    November 07, 2008
    PingBack from http://mstechnews.info/2008/11/tip-21-did-you-knowhow-to-set-a-fixed-port-for-the-developer-web-server/

  • Anonymous
    November 07, 2008
    Your VS works differently from mine.  All I have is a Misc. Tab not a Developer Server Tab.  Am I missing something?

  • Anonymous
    November 10, 2008
    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.

  • Anonymous
    November 13, 2008
    The comment has been removed

  • Anonymous
    December 01, 2008
    The comment has been removed

  • Anonymous
    December 01, 2008
    The comment has been removed

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

  • Anonymous
    December 06, 2008
    @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.
  • Anonymous
    May 19, 2009
    Сегодня я улетаю в очень насыщенную деловую поездку (22000 миль, 5 стран, 3 континента, 1 неделя, никакого

  • Anonymous
    July 17, 2009
    Соберем для Вас по сети интернет базу данных потенциальных клиентов для Вашего Бизнеса (Название телефон факс email www имена адреса итд) Более подробную информацию Вы сможете получить по телефону +79133913837 ICQ: 6288862 SKYPE: prodawez EMAIL: prodawez@mixmail.com

  • Anonymous
    May 31, 2010
    It has been a while since this post has been written but it still helped me. To find the properties panel, just click on the website name and press 'F4' key. Using the right button option it did not work for me. Thanks,

  • Anonymous
    November 10, 2011
    The comment has been removed