简体   繁体   中英

ASP.Net project website location

I just created a Visual Studio ASP.Net MVC razor project, built and ran. The website showed up in my browser at

localhost:49577

The localhost part is expected. But what is the 49577? How did it decide to put it there? Can I change it? If so, how?

That's a port number .

Visual Studio picks a random port for each project; you can change it in Project Properties.

You can change port in visual studio, I don't know your VS studio version.

For 2012 version of VS:

Right click on a project -> choose Properties -> Choose Web tab -> edit Project Url

or

read this: http://msdn.microsoft.com/en-us/library/ms178109.aspx

That is the port number. It is auto assigned by visual studio development server.

If you right click the project name in the solution explorer and go to web, you can choose to auto assign this port, or set a specific port number.

You can also choose to use your local machines IIS, but you will need administrator priviledges.

The number that you are referring to is the Port Number for your project(Web Application) that is randomly generated when you start your project.This helps IIS Express or Local Development Server listen to your request.

You can change it manually. See Specify a Port for the Development Server

对于VS2010,它是:右键单击Project-> Properties-> Web-> Servers-> Specific Port

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM