How can I change the project port number in Visual Studio 2013 ?
I\'m using ASP.Net and I need to change the port number while debugging in Visual Studio 2013.
To specify a port for the ASP.NET Development Server
In Solution Explorer, click the name of the application.
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.
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.
Each time you run a file-system Web site within Visual Web Developer, the ASP.NET Development Server will listen on the specified port.
Hope this helps.
see below snap.
The Visual Studio Development Server option applies only when you are running (testing) the Web project in Visual Studio. Production Web applications always run under IIS.
To specify the Web server for a Web site project
- In Solution Explorer, right-click the name of the Web site project for which you want to specify a Web server, and then click Property Pages.
- In the Property Pages dialog box, click the Start Options tab.
- Under Server, click Use custom server.
- In the Base URL box, type the URL that Visual Studio should start when running the current project.
Note: If you specify the URL of a remote server (for example, an IIS Web application on another computer), be sure that the remote server is running at least the .NET Framework version 2.0.
To specify the Web server for a Web application project
- In Solution Explorer, right-click the name of the Web application project for which you want to specify a Web server, and then click Properties.
- In the Properties window, click the Web tab.
- Under Servers, click Use Visual Studio Development Server or Use Local IIS Web server or Use Custom Web server.
- If you clicked Local IIS Web server or Use Custom Web Server, in the Base URL box, type the URL that Visual Studio should start when running the current project.
Note: If you clicked Use Custom Web Server and specify the URL of a remote server (for example, an IIS Web application on another computer), be sure that the remote server is running at least the .NET Framework version 2.0.
(Source: https://msdn.microsoft.com/en-us/library/ms178108.aspx)
Well, I simply could not find this (for me) mythical "Use dynamic ports" option. I have post screenshots.
On a more constructive note, I believe that the port numbers are to be found in the solution file AND CRUCIALLY cross referenced against the IIS Express config file
C:\Users\<username>\Documents\IISExpress\config\applicationhost.config
I tried editing the port number in just the solution file but strange things happened. I propose (no time yet) that it needs a consistent edit across both the solution file and the config file.
This has proved to be elusive for me (WebSite Project) until I figured out the following procedure, which combines the solution provided by @Jimmy, with the added step of checking out the solution from Source Control
Steps: (if using VS2013+ with website project and SourceControl)
VWDPort = ......
and change to desired port: (example: "60000" - depends on your IISExpress Settings)Steps to resolve this: