c# - Cannot deploy ASP.NET MVC + React to Azure
问题描述
I spent almost a day to troubleshoot the problem and still have no result. Problem: I created a new ASP.NET MVC + React project, NET.core 3.0. When I deploy it to Azure, I got error:
HTTP Error 500.30 - ANCM In-Process Start Failure
Common solutions to this issue:
The application failed to start
The application started but then stopped
The application started but threw an exception during startup
Troubleshooting steps:
Check the system event log for error messages
Enable logging the application process' stdout messages
Attach a debugger to the application process and inspect
For more information visit: https://go.microsoft.com/fwlink/?LinkID=2028265
However, when I create a new project ASP.NET MVC + React project, NET.core 2.2 and deploy it, everything works well. So, I believe, the problem is NET.core 3.0. Under Development tools -> Extensions, I installed:
ASP.NET Core 2.2 (x64) Runtime
ASP.NET Core 3.0 (x64) Runtime
ASP.NET Core 3.0 (x86) Runtime
ASP.NET Core Logging Integration
Also, I found that error in logs
Application startup exception: System.InvalidOperationException: Key type not specified.
at Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ConfigureSigningCredentials.LoadKey()
at Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ConfigureSigningCredentials.Configure(ApiAuthorizationOptions options)
.....
at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token)
at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host)
at ApplicationProcessingApp.Program.Main(String[] args) in C:\Users\Test\Source\Repos\Test\ApplicationProcessingApp\ApplicationProcessingApp\Program.cs:line 16
Program.cs:line 16
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}
Nothing works. I stuck there. I am asking help from the community. Any suggestions will be appreciated. Thank you!
UPDATE: I added that line to appsettings.json and error above was gone. Right now, my browser returns error 500.
"Key": {
"Type": "Development"
},
解决方案
So, answer was on the top. You have to edit you appsettings.json and make you IdentityServer like that
"IdentityServer": {
"Key": {
"Type": "Development"
},
"Clients": {
"ApplicationProcessingApp": {
"Profile": "IdentityServerSPA"
}
}
},
I added that part
"Key": {
"Type": "Development"
}
推荐阅读
- r - 我应该在哪里对条形图重新排序以使条形组与数据框的顺序相同
- c++ - shared_ptr 没有可行的重载 '='
- wordpress - 如何在产品标题中插入类别名称?
- java - 无法使用 DataSourceFactory 编译 Dropwizard 应用程序
- postgresql - 在使用 postgresql 的存储库包 Spring Boot 中接受带有 @Query 注释的参数
- terraform - 更新到 terraform 版本 0.12.26 后出现“不明确的属性键”错误
- html - 如何在视觉代码中使用图像它不起作用?
- python - 检查行是否与文件中的另一行相同
- javascript - 错误提供 .render 不是 ReactJS 中的函数。App.js 未在 LocalHost 上正常运行
- sharepoint - 如何创建从共享点在线站点到另一个站点 api 的 HTTP 获取请求