You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Visual Studio 2019中ASP.NET应用HTTPS端口改5000后自动恢复如何解决

解决步骤

  • 先完全关闭Visual Studio 2019,防止配置被实时覆盖
  • 找到你的项目对应的.csproj工程文件,用任意文本编辑器打开,定位到<WebProjectProperties>节点,修改两个配置项:
    • 将<SslPort>的值改为5000
    • 将<IISUrl>的值改为https://localhost:5000/
  • 保存.csproj文件后,打开解决方案目录下.vs\[你的解决方案名]\config\applicationhost.config文件,确认绑定配置为:
<bindings>
    <binding protocol="http" bindingInformation="*:5000:localhost" />
    <binding protocol="https" bindingInformation="*:5000:localhost" />
</bindings>
  • 重新打开Visual Studio加载项目,进入项目属性的「Web」选项卡,确认SSL URL已显示为https://localhost:5000,点击「创建虚拟目录」保存配置即可

补充说明

如果配置后仍然失效,可先运行netstat -ano | findstr "5000"命令检查5000端口是否被其他进程占用,如有占用先结束对应进程再重试。

内容的提问来源于stack exchange,提问作者Anjali

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.26 14:15:08