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

即使成功注册,也无法浏览到托管在 IIS Express 中的站点

如何解决即使成功注册,也无法浏览到托管在 IIS Express 中的站点

我正在尝试在 IIS Express 中运行 ASP.NET Core MVC 应用程序(100% 模板)。该站点似乎已托管在 IIS Express 中,但是当我在浏览器中打开该站点时,出现一般错误“无法访问此站点”。有什么想法吗?

来自 Visual Studio

Starting IIS Express ...
Successfully registered URL "http://localhost:55516/" for site "WebApplication1" application "/"
Successfully registered URL "https://localhost:44331/" for site "WebApplication1" application "/"
Registration completed for site "WebApplication1"
IIS Express is running.
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development

看看 DevTool,这是我得到的回应:

enter image description here

我的launchSettings.json:

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

编辑:有趣的是,如果我从 VS F5 就不会运行。如果我从 CLI 运行“dotnet run”,它运行得非常好......为什么???

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