微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

IIS Express 端口 - 文件中的多个端口

如何解决IIS Express 端口 - 文件中的多个端口

愚蠢的问题,但我找不到它。为什么 IIS express 使用 2 个端口(下面的示例文件)。

其次,在这里的这个练习中,当我被要求设置一个应用程序时,它引用了 3007,我无法访问它。 https://docs.microsoft.com/en-us/learn/modules/identity-application-types/5-exercise-web-apps-call-apis

{
  "iisSettings": {
    "windowsAuthentication": false,"anonymousAuthentication": true,"iisExpress": {
      "applicationUrl": "https://localhost:3007","sslPort": 3007
    }
  },"profiles": {
    "IIS Express": {
      "commandName": "IISExpress","launchbrowser": true,"environmentvariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },"IdentityWeb": {
      "commandName": "Project","dotnetRunMessages": "true","applicationUrl": "https://localhost:5001;http://localhost:5000","environmentvariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}

解决方法

iisSettings 用于运行 VS2019 或其他 Visual Studio 版本的 IDE。

IdentityWeb(peojectname) 用于 dotnet 命令行。

官方文档: Development and launchSettings.json

这些只是项目根据运行环境的不同配置,无需纠结。

测试步骤。


  1. 在 vs2019 中删除 iisSettings,然后更改属性,然后检查 launchSettings.json 文件。

    之前删除的ssl端口是44316,那我们就删了。更改属性后,生成新的ssl端口。

    enter image description here

    现在,我们可以运行项目(我们需要重新启动 IDE [vs2019]),它工作正常。

    enter image description here


  1. 修改 IdentityWeb 中的 applicationUrl。

    enter image description here

    在项目文件夹中打开 cmd 或 powershell。

    enter image description here

    enter image description here


版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。