如何解决在asp.NET开发服务器的端口号

编程入门 行业动态 更新时间:2024-10-11 23:22:46
本文介绍了如何解决在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:

localhost:2038/Projects/test.html

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

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

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:

  • 在解决方案资源管理器中,单击该应用程序的名称。
  • 在属性窗格中,单击使用动态端口旁边的向下箭头,然后选择从下拉列表中假。这将使端口号属性的编辑。
  • 在属性窗格中,单击旁边的端口号的文本框,并输入一个端口号。
  • 单击属性窗格之外。这样可以节省的属性设置。每次运行Visual Web开发中的文件系统网站时,ASP.NET开发服务器将侦听指定的端口上。
  • 更多信息:如何:指定端口对于ASP.NET开发服务器

    更多推荐

    如何解决在asp.NET开发服务器的端口号

    本文发布于:2023-11-13 22:57:53,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1585555.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:如何解决   端口号   服务器   NET   asp

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!