如何解决在asp.NET开发服务器的端口号 [英] How to fix a port number in asp.NET development server

查看:898
本文介绍了如何解决在asp.NET开发服务器的端口号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天我在写一个独立的html的网页。我看它每次,该文件在本地主机已运行。因此,端口号是由我的操作系统(Windows 8)分配。

Yesterday I was writing a stand-alone .html web-page. Every time I viewed it, the file was run in the local host. Thus a port number was assigned by my OS (Windows 8).

我的文件的路径是这样的:

The path to my file looked like this:

http://localhost:2038/Projects/test.html

但是今天,当我运行它,ASP.NET开发服务器分配一个不同的端口号:

But today, when I run it, the ASP.NET Development Server assigned a different port number:

http://localhost:27290/Projects/test.html

现在我的重定向不工作。
此文件是纯粹的独立文件。它不是一个Visual Studio的Web项目或任何东西的一部分。因此,有在Visual Studio中没有项目的设置来改变。不过我确实使用Visual Studio作为一个文本编辑器。
要查看浏览器中的文件覆盖在VS2012文件我只需右键单击并选择:在浏览器中查看(谷歌浏览器)

Now my redirects don't work. This file is pure a stand-alone file. It is not part of a visual studio web-project or anything. So there are no project settings in visual studio to alter. However I do use visual studio as a text editor. To view the file in the browser I simply right-click over the file in VS2012 and select: 'View in Browser (Google Chrome)'

在我在Chrome中查看时,Windows 8从工具栏区域,通知我说,ASP.NET开发服务器运行的是弹出一个消息。并列出太新的端口。

After I view it in Chrome, Windows 8 pops up a message from the toolbar area informing me that ASP.NET Development Server is running. And it lists the new port too.

我如何更改端口为固定的东西,而不是一些随机值?

How do I change the port to something fixed and not some random value?

谢谢!

推荐答案

要指定端口为ASP.NET开发服务器:

To specify a port for the ASP.NET Development Server:


  1. 在解决方案资源管理器中,单击该应用程序的名称。

  2. 在属性窗格中,单击使用动态端口旁边的向下箭头,然后选择从下拉列表中假。这将使端口号属性的编辑。

  3. 在属性窗格中,单击旁边的端口号的文本框,并输入一个端口号。

  4. 单击属性窗格之外。这样可以节省的属性设置。每次运行Visual Web开发中的文件系统网站时,ASP.NET开发服务器将侦听指定的端口上。

更多信息:如何:指定端口对于ASP.NET开发服务器

这篇关于如何解决在asp.NET开发服务器的端口号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆