首页 > 解决方案 > 无法运行 Visual Studio 部署的网站 - GET http://localhost:8080/_configuration/MyApp 404?

问题描述

我在 Visual Studio 2019 中创建了一个新的 ASP.NET Core Web 应用程序(.Net Core 3.1,Angular,具有“个人用户帐户/应用程序内存储用户帐户”的身份验证)。

然后我将应用程序发布到文件夹...\bin\Release\netcoreapp3.1\publish\

然后我尝试测试部署的网站

  1. MyApp.exe进去...\bin\Release\netcoreapp3.1\publish\
PS C:\Users\.....\bin\Release\netcoreapp3.1\publish> .\MyApp.exe
信息:IdentityServer4.Startup[0]
      启动 IdentityServer4 版本 3.0.0.0
信息:IdentityServer4.Startup[0]
      为 IdentityServer 使用显式配置的身份验证方案 Identity.Application
信息:Microsoft.Hosting.Lifetime[0]
      现在收听:http://localhost:5000
信息:Microsoft.Hosting.Lifetime[0]
      现在收听:https://localhost:5001
信息:Microsoft.Hosting.Lifetime[0]
      申请开始。按 Ctrl+C 关闭。
信息:Microsoft.Hosting.Lifetime[0]
      托管环境:生产
信息:Microsoft.Hosting.Lifetime[0]
      内容根路径:C:\Users\wfaaf\source\repos\MyApp2\MyApp\bin\Release\netcoreapp3.1\publish
  1. \bin\Release\netcoreapp3.1\publish\ClientApp\dist\在 IIS 中复制和托管。

网页显示在浏览器中。但是,控制台显示错误?

polyfills-es2015.0ef207fb7b4761464817.js:1 GET http://localhost:8080/_configuration/MyApp 404(未找到)

polyfills-es2015.0ef207fb7b4761464817.js:1 GET http://localhost:8080/_configuration/MyApp 404(未找到)

main-es2015.faf629d7395bba656bc6.js:1 错误错误:未捕获(承诺):错误:无法加载“MyApp”的设置

main-es2015.faf629d7395bba656bc6.js:1 ERROR 错误:无法加载“MyApp”的设置

main-es2015.faf629d7395bba656bc6.js:1 ERROR 错误:无法加载“MyApp”的设置

的主机http://localhost:8080/_configuration/MyApp应该是https://localhost:5001. 如何设置?

标签: asp.netangularvisual-studioasp.net-core

解决方案


推荐阅读