asp.net - 无法运行 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\
。
然后我尝试测试部署的网站
- 跑
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
\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
. 如何设置?
解决方案
推荐阅读
- security - 我们可以将加密的秘密(安全地)存储在环境变量中吗?
- javascript - 我如何导出一个 JavaScript 类
- pandas - 使用pandas库根据csv中的另一个列值填充空白值
- java - 无法解析 imageView 中的方法 setText()
- javascript - 由于 ./node_modules/vue-loader/lib/template-compiler 中的错误,模块构建失败
- javascript - React Scriptloader 创建酶状态问题
- javascript - 根据 toLocaleTimeString() 将 12 小时 hh:mm AM/PM 转换为 24 小时 hh:mm
- android - 如何修复共享首选项在 Flutter 中返回空字符串?
- reactjs - 将类组件更改为功能组件
- bash - 使用bash将日期列表从文件转换为时间戳