简体   繁体   English

ASP.Net项目网站位置

[英]ASP.Net project website location

I just created a Visual Studio ASP.Net MVC razor project, built and ran. 我刚刚创建并运行了一个Visual Studio ASP.Net MVC剃刀项目。 The website showed up in my browser at 该网站显示在我的浏览器中,网址为

localhost:49577

The localhost part is expected. 本地主机部分是预期的。 But what is the 49577? 但是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; Visual Studio为每个项目选择一个随机端口; you can change it in Project Properties. 您可以在项目属性中更改它。

You can change port in visual studio, I don't know your VS studio version. 您可以在Visual Studio中更改端口,我不知道您的VS Studio版本。

For 2012 version of VS: 对于2012版的VS:

Right click on a project -> choose Properties -> Choose Web tab -> edit Project Url 右键单击项目->选择属性 ->选择Web选项卡->编辑项目网址

or 要么

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

That is the port number. 那是端口号。 It is auto assigned by visual studio development server. 它由Visual Studio开发服务器自动分配。

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. 如果在解决方案资源管理器中右键单击项目名称并访问Web,则可以选择自动分配此端口,或设置特定的端口号。

You can also choose to use your local machines IIS, but you will need administrator priviledges. 您也可以选择使用本地计算机IIS,但需要管理员权限。

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. 您所指的数字是您在启动项目时随机生成的项目(Web应用程序)的端口号 。这有助于IIS Express或Local Development Server侦听您的请求。

You can change it manually. 您可以手动更改。 See Specify a Port for the Development Server 请参阅为开发服务器指定端口

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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