【问题标题】:Cannot deploy ASP.NET MVC + React to Azure无法将 ASP.NET MVC + React 部署到 Azure
【发布时间】:2020-03-06 05:23:22
【问题描述】:

我花了将近一天的时间来解决问题,但仍然没有结果。 问题:我创建了一个新的 ASP.NET MVC + React 项目,NET.core 3.0。当我将它部署到 Azure 时,出现错误:

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

但是,当我创建一个新项目 ASP.NET MVC + React 项目 NET.core 2.2 并部署它时,一切正常。所以,我相信,问题在于 NET.core 3.0。 在 Development tools -> Extensions 下,我安装了:

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

另外,我在日志中发现了这个错误

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:第 16 行

        public static void Main(string[] args)
        {
            CreateWebHostBuilder(args).Build().Run();
        }

没有任何作用。我卡在那里。我正在向社区寻求帮助。任何建议将不胜感激。 谢谢!

更新: 我将该行添加到 appsettings.json 并且上面的错误消失了。现在,我的浏览器返回错误 500。

"Key": {
      "Type": "Development"
    },

【问题讨论】:

  • 您是否尝试部署到 Azure We App?
  • 是的,我正在尝试部署到 Azure Web App

标签: c# asp.net-mvc reactjs azure asp.net-core


【解决方案1】:

所以,答案在最上面。 你必须编辑你的 appsettings.json 并使你的 IdentityServer 像那样

  "IdentityServer": {
    "Key": {
      "Type": "Development"
    },
    "Clients": {
      "ApplicationProcessingApp": {
        "Profile": "IdentityServerSPA"
      }
    }
  },

我添加了那部分

 "Key": {
      "Type": "Development"
    }

【讨论】:

    猜你喜欢
    • 2016-05-22
    • 1970-01-01
    • 2012-04-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多