Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing project port number in Visual Studio 2013

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.

like image 604
tubefavorites.com Avatar asked Apr 02 '14 20:04

tubefavorites.com


People also ask

How do I change the project port number in Visual Studio?

In Solution Explorer, right-click the name of the web application and select Properties. Click the Web tab. In the Servers section, under dropdown selection for IIS Express, change the port number in the Project URL box. To the right of the Project URL box, click Create Virtual Directory, and then click OK.

How do I find my project port number?

Open the command prompt. Type “netstat -ano” without the quotes. -a:Displays all active TCP connections and the TCP and UDP ports on which the computer is listening. -n: Displays active TCP connections, however, addresses and port numbers are expressed numerically and no attempt is made to determine names.

How to change port number in Visual Studio Code?

1. Right Click your Project in the Solution Explorer and click on Properties option in the Context menu. 2. In the Properties window, navigate to the Debug Tab and scroll down to the Web Server Settings section. 3. There in the App URL TextBox, change the Port Number as shown below.

How do I change the default port in visual web developer?

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.

How do I change the port number of a web application?

Right click the web application and select "properties". There should be a 'Web' tab where http://localhost:XXXXX is specified - change the port number there and this will modify the configuration to use your new port number.

How do I change the port number in IIS Express?

Here is a fast recipe on how to manually change the port number to whatever number you want: In Solution Explorer, right-click the name of the web application and select Properties. Click the Web tab. In the Servers section, under dropdown selection for IIS Express, change the port number in the Project URL box.


1 Answers

There are two project types in VS for ASP.NET projects:

Web Application Projects (which notably have a .csproj or .vbproj file to store these settings) have a Properties node under the project. On the Web tab, you can configure the Project URL (assuming IIS Express or IIS) to use whatever port you want, and just click the Create Virtual Directory button. These settings are saved to the project file:

<ProjectExtensions>   <VisualStudio>     <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">       <WebProjectProperties>        <DevelopmentServerPort>10531</DevelopmentServerPort>        ...      </WebProjectProperties>     </FlavorProperties>   </VisualStudio> </ProjectExtensions> 

Web Site Projects are different. They don't have a .*proj file to store settings in; instead, the settings are set in the solution file. In VS2013, the settings look something like this:

Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "WebSite1(1)", "http://localhost:10528", "{401397AC-86F6-4661-A71B-67B4F8A3A92F}"     ProjectSection(WebsiteProperties) = preProject         UseIISExpress = "true"         TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.5"         ...         SlnRelativePath = "..\..\WebSites\WebSite1\"         DefaultWebSiteLanguage = "Visual Basic"     EndProjectSection EndProject 

Because the project is identified by the URL (including port), there isn't a way in the VS UI to change this. You should be able to modify the solution file though, and it should work.

like image 158
Jimmy Avatar answered Sep 20 '22 17:09

Jimmy