views:

1266

answers:

4

I have a WebSite project in Visual Studio 2008 (not a Web Application project!)

How do I set the ASP.NET Development startup port to a static port in a WebSite project?

A: 

It can't be done with a Website project, the port number is randomly assigned.

It's only possible with a Web App Project

dxbmatt
I stand corrected. The solution from backslash17 works
dxbmatt
+6  A: 

To specify a port for the ASP.NET Development Server - WebSite / WebServices projects

  1. In Solution Explorer, click the name of the application.
  2. In the Properties pane, click the down-arrow beside Use dynamic ports and select False from the dropdown list. This will enable editing of the Port number property.
  3. In the Properties pane, click the text box beside Port number and type in a port number. Click outside of the Properties pane.This saves the property settings.
  4. Each time you run a file-system Web site within Visual Web Developer, the ASP.NET
    Development Server will listen on the specified port.
backslash17
Cleverly hidden in plain sight...
Alex Czarto
A: 

this post should answer your question. what Backslash17 has mentioned is for asp.net web application. if you need a solution for asp.net web site check the link: http://www.taslimi.ir/post/Assign-a-static-port-to-Aspnet-Website.aspx

Vahid
Actually, Backslash17's answer worked perfectly for my website project.
Alex Czarto
A: 

Press F4 to get the Properties Pane. And then one can get the option mentioned by Backslash17

Gulia