ASP.NET Core 3和500.30进程内启动失败

时间:2019-10-15 14:44:44

标签: azure asp.net-core .net-core-3.0 asp.net-core-3.0

我的服务针对以下框架:

  • Microsoft.AspNetCore.App 3.0.0
  • Microsoft.NETCore.App 3.0.0

一切都在本地运行良好。当我在Azure中部署到App Service时,会遇到以下错误:

  

500.30进程内启动失败

读取documentation可能会告诉我,这些框架可能不在托管我的服务的计算机上。但是,我通过在App Service控制台上运行dotnet --info来检查计算机上安装了哪些框架,得到了以下结果:

.NET Core SDK (reflecting any global.json):
 Version:   2.2.109
 Commit:    586f23c400

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14393
 OS Platform: Windows
 RID:         win10-x86
 Base Path:   D:\Program Files (x86)\dotnet\sdk\2.2.109\

Host (useful for support):
  Version: 3.0.0
  Commit:  7d57652f33

.NET Core SDKs installed:
  1.1.14 [D:\Program Files (x86)\dotnet\sdk]
  2.1.509 [D:\Program Files (x86)\dotnet\sdk]
  2.1.701 [D:\Program Files (x86)\dotnet\sdk]
  2.2.108 [D:\Program Files (x86)\dotnet\sdk]
  2.2.109 [D:\Program Files (x86)\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.12 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.13 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.6 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.7 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.12 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.13 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.6 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.7 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 1.0.16 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.1.13 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.9 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.12 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.13 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.6 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.7 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

很明显,我的两个目标框架都存在于机器上。

(部分)证明我的文件已部署:

Deployed files for my app service

这是我的启动文件(没什么异常):

    public class Startup
    {
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        public void ConfigureServices(IServiceCollection services)
        {
            services.AddCors();
            services.AddControllers();
        }

        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseCors();

            app.UseRouting();
            app.UseEndpoints(endpoints => {
                endpoints.MapControllers();
            });
        }
    }

我在做什么错?为什么会出现此错误?

如果有帮助,这里有一些事件日志:

<Events>
    <Event>
        <System>
            <Provider Name="HttpPlatformHandler"/>
            <EventID>2000</EventID>
            <Level>4</Level>
            <Task>0</Task>
            <Keywords>Keywords</Keywords>
            <TimeCreated SystemTime="2019-10-15T10:18:07Z"/>
            <EventRecordID>622276312</EventRecordID>
            <Channel>Application</Channel>
            <Computer>RD281878C98595</Computer>
            <Security/>
        </System>
        <EventData>
            <Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=050F22D8 [TID 2092] [PID 5816]</Data>
        </EventData>
    </Event>
    <Event>
        <System>
            <Provider Name="ZipFS"/>
            <EventID>0</EventID>
            <Level>1</Level>
            <Task>0</Task>
            <Keywords>Keywords</Keywords>
            <TimeCreated SystemTime="2019-10-15T10:18:15Z"/>
            <EventRecordID>622284390</EventRecordID>
            <Channel>Application</Channel>
            <Computer>RD281878C98595</Computer>
            <Security/>
        </System>
        <EventData>
            <Data>Failed to open siteversion.txt. ZipFS setup failed. Error: 0x80070003</Data>
        </EventData>
    </Event>
    <Event>
        <System>
            <Provider Name="HttpPlatformHandler"/>
            <EventID>2000</EventID>
            <Level>4</Level>
            <Task>0</Task>
            <Keywords>Keywords</Keywords>
            <TimeCreated SystemTime="2019-10-15T10:18:22Z"/>
            <EventRecordID>622291296</EventRecordID>
            <Channel>Application</Channel>
            <Computer>RD281878C98595</Computer>
            <Security/>
        </System>
        <EventData>
            <Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=0596E698 [TID 3800] [PID 5152]</Data>
        </EventData>
    </Event>
    <Event>
        <System>
            <Provider Name="IIS AspNetCore Module V2"/>
            <EventID>1018</EventID>
            <Level>1</Level>
            <Task>0</Task>
            <Keywords>Keywords</Keywords>
            <TimeCreated SystemTime="2019-10-15T10:20:13Z"/>
            <EventRecordID>622401953</EventRecordID>
            <Channel>Application</Channel>
            <Computer>RD281878C98595</Computer>
            <Security/>
        </System>
        <EventData>
            <Data>Application '/LM/W3SVC/1682960519/ROOT' with physical root 'D:\home\site\wwwroot\' hit unexpected managed exception, exception code = '0xe0434352'. Please check the stderr logs for more information.</Data>
            <Data>Process Id: 5988.</Data>
            <Data>File Version: 12.2.18316.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: ce8cf65589734f82b0536c543aba5bd60d0a5a98</Data>
        </EventData>
    </Event>
    <Event>
        <System>
            <Provider Name="IIS AspNetCore Module V2"/>
            <EventID>1007</EventID>
            <Level>1</Level>
            <Task>0</Task>
            <Keywords>Keywords</Keywords>
            <TimeCreated SystemTime="2019-10-15T10:20:13Z"/>
            <EventRecordID>622401968</EventRecordID>
            <Channel>Application</Channel>
            <Computer>RD281878C98595</Computer>
            <Security/>
        </System>
        <EventData>
            <Data>Application '/LM/W3SVC/1682960519/ROOT' with physical root 'D:\home\site\wwwroot\' failed to load clr and managed application. CLR worker thread exited prematurely</Data>
            <Data>Process Id: 5988.</Data>
            <Data>File Version: 12.2.18316.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: ce8cf65589734f82b0536c543aba5bd60d0a5a98</Data>
        </EventData>
    </Event>
    <Event>
        <System>
            <Provider Name="HttpPlatformHandler"/>
            <EventID>2000</EventID>
            <Level>4</Level>
            <Task>0</Task>
            <Keywords>Keywords</Keywords>
            <TimeCreated SystemTime="2019-10-15T10:21:17Z"/>
            <EventRecordID>622466890</EventRecordID>
            <Channel>Application</Channel>
            <Computer>RD281878C98595</Computer>
            <Security/>
        </System>
        <EventData>
            <Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=04F7E110 [TID 6744] [PID 5988]</Data>
        </EventData>
    </Event>
    <Event>
        <System>
            <Provider Name="HttpPlatformHandler"/>
            <EventID>2000</EventID>
            <Level>4</Level>
            <Task>0</Task>
            <Keywords>Keywords</Keywords>
            <TimeCreated SystemTime="2019-10-15T10:21:19Z"/>
            <EventRecordID>622467953</EventRecordID>
            <Channel>Application</Channel>
            <Computer>RD281878C98595</Computer>
            <Security/>
        </System>
        <EventData>
            <Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=05CBC280 [TID 12796] [PID 12656]</Data>
        </EventData>
    </Event>
    <Event>
        <System>
            <Provider Name="IIS AspNetCore Module V2"/>
            <EventID>1018</EventID>
            <Level>1</Level>
            <Task>0</Task>
            <Keywords>Keywords</Keywords>
            <TimeCreated SystemTime="2019-10-15T10:21:42Z"/>
            <EventRecordID>622491921</EventRecordID>
            <Channel>Application</Channel>
            <Computer>RD281878C98595</Computer>
            <Security/>
        </System>
        <EventData>
            <Data>Application '/LM/W3SVC/1682960519/ROOT' with physical root 'D:\home\site\wwwroot\' hit unexpected managed exception, exception code = '0xe0434352'. Please check the stderr logs for more information.</Data>
            <Data>Process Id: 2940.</Data>
            <Data>File Version: 12.2.18316.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: ce8cf65589734f82b0536c543aba5bd60d0a5a98</Data>
        </EventData>
    </Event>
    <Event>
        <System>
            <Provider Name="IIS AspNetCore Module V2"/>
            <EventID>1007</EventID>
            <Level>1</Level>
            <Task>0</Task>
            <Keywords>Keywords</Keywords>
            <TimeCreated SystemTime="2019-10-15T10:21:42Z"/>
            <EventRecordID>622491937</EventRecordID>
            <Channel>Application</Channel>
            <Computer>RD281878C98595</Computer>
            <Security/>
        </System>
        <EventData>
            <Data>Application '/LM/W3SVC/1682960519/ROOT' with physical root 'D:\home\site\wwwroot\' failed to load clr and managed application. CLR worker thread exited prematurely</Data>
            <Data>Process Id: 2940.</Data>
            <Data>File Version: 12.2.18316.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: ce8cf65589734f82b0536c543aba5bd60d0a5a98</Data>
        </EventData>
    </Event>
    <Event>
        <System>
            <Provider Name="HttpPlatformHandler"/>
            <EventID>2000</EventID>
            <Level>4</Level>
            <Task>0</Task>
            <Keywords>Keywords</Keywords>
            <TimeCreated SystemTime="2019-10-15T11:06:27Z"/>
            <EventRecordID>625176281</EventRecordID>
            <Channel>Application</Channel>
            <Computer>RD281878C98595</Computer>
            <Security/>
        </System>
        <EventData>
            <Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=055FA240 [TID 12556] [PID 7444]</Data>
        </EventData>
    </Event>
    <Event>
        <System>
            <Provider Name="HttpPlatformHandler"/>
            <EventID>2000</EventID>
            <Level>4</Level>
            <Task>0</Task>
            <Keywords>Keywords</Keywords>
            <TimeCreated SystemTime="2019-10-15T11:07:41Z"/>
            <EventRecordID>625250078</EventRecordID>
            <Channel>Application</Channel>
            <Computer>RD281878C98595</Computer>
            <Security/>
        </System>
        <EventData>
            <Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=059F8DE0 [TID 12108] [PID 2940]</Data>
        </EventData>
    </Event>
    <Event>
        <System>
            <Provider Name="IIS AspNetCore Module V2"/>
            <EventID>1018</EventID>
            <Level>1</Level>
            <Task>0</Task>
            <Keywords>Keywords</Keywords>
            <TimeCreated SystemTime="2019-10-15T12:27:39Z"/>
            <EventRecordID>630047968</EventRecordID>
            <Channel>Application</Channel>
            <Computer>RD281878C98595</Computer>
            <Security/>
        </System>
        <EventData>
            <Data>Application '/LM/W3SVC/1682960519/ROOT' with physical root 'D:\home\site\wwwroot\' hit unexpected managed exception, exception code = '0xe0434352'. Please check the stderr logs for more information.</Data>
            <Data>Process Id: 13184.</Data>
            <Data>File Version: 12.2.18316.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: ce8cf65589734f82b0536c543aba5bd60d0a5a98</Data>
        </EventData>
    </Event>
    <Event>
        <System>
            <Provider Name="IIS AspNetCore Module V2"/>
            <EventID>1007</EventID>
            <Level>1</Level>
            <Task>0</Task>
            <Keywords>Keywords</Keywords>
            <TimeCreated SystemTime="2019-10-15T12:27:39Z"/>
            <EventRecordID>630047968</EventRecordID>
            <Channel>Application</Channel>
            <Computer>RD281878C98595</Computer>
            <Security/>
        </System>
        <EventData>
            <Data>Application '/LM/W3SVC/1682960519/ROOT' with physical root 'D:\home\site\wwwroot\' failed to load clr and managed application. CLR worker thread exited prematurely</Data>
            <Data>Process Id: 13184.</Data>
            <Data>File Version: 12.2.18316.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: ce8cf65589734f82b0536c543aba5bd60d0a5a98</Data>
        </EventData>
    </Event>
    <Event>
        <System>
            <Provider Name="HttpPlatformHandler"/>
            <EventID>2000</EventID>
            <Level>4</Level>
            <Task>0</Task>
            <Keywords>Keywords</Keywords>
            <TimeCreated SystemTime="2019-10-15T12:28:20Z"/>
            <EventRecordID>630089140</EventRecordID>
            <Channel>Application</Channel>
            <Computer>RD281878C98595</Computer>
            <Security/>
        </System>
        <EventData>
            <Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=05284660 [TID 7644] [PID 13184]</Data>
        </EventData>
    </Event>
    <Event>
        <System>
            <Provider Name="IIS AspNetCore Module V2"/>
            <EventID>1018</EventID>
            <Level>1</Level>
            <Task>0</Task>
            <Keywords>Keywords</Keywords>
            <TimeCreated SystemTime="2019-10-15T12:28:35Z"/>
            <EventRecordID>630104687</EventRecordID>
            <Channel>Application</Channel>
            <Computer>RD281878C98595</Computer>
            <Security/>
        </System>
        <EventData>
            <Data>Application '/LM/W3SVC/1682960519/ROOT' with physical root 'D:\home\site\wwwroot\' hit unexpected managed exception, exception code = '0xe0434352'. Please check the stderr logs for more information.</Data>
            <Data>Process Id: 5864.</Data>
            <Data>File Version: 12.2.18316.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: ce8cf65589734f82b0536c543aba5bd60d0a5a98</Data>
        </EventData>
    </Event>
    <Event>
        <System>
            <Provider Name="IIS AspNetCore Module V2"/>
            <EventID>1007</EventID>
            <Level>1</Level>
            <Task>0</Task>
            <Keywords>Keywords</Keywords>
            <TimeCreated SystemTime="2019-10-15T12:28:35Z"/>
            <EventRecordID>630104703</EventRecordID>
            <Channel>Application</Channel>
            <Computer>RD281878C98595</Computer>
            <Security/>
        </System>
        <EventData>
            <Data>Application '/LM/W3SVC/1682960519/ROOT' with physical root 'D:\home\site\wwwroot\' failed to load clr and managed application. CLR worker thread exited prematurely</Data>
            <Data>Process Id: 5864.</Data>
            <Data>File Version: 12.2.18316.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: ce8cf65589734f82b0536c543aba5bd60d0a5a98</Data>
        </EventData>
    </Event>
    <Event>
        <System>
            <Provider Name="HttpPlatformHandler"/>
            <EventID>2000</EventID>
            <Level>4</Level>
            <Task>0</Task>
            <Keywords>Keywords</Keywords>
            <TimeCreated SystemTime="2019-10-15T12:37:24Z"/>
            <EventRecordID>630633328</EventRecordID>
            <Channel>Application</Channel>
            <Computer>RD281878C98595</Computer>
            <Security/>
        </System>
        <EventData>
            <Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=058C0638 [TID 12688] [PID 6308]</Data>
        </EventData>
    </Event>
    <Event>
        <System>
            <Provider Name="HttpPlatformHandler"/>
            <EventID>2000</EventID>
            <Level>4</Level>
            <Task>0</Task>
            <Keywords>Keywords</Keywords>
            <TimeCreated SystemTime="2019-10-15T12:37:24Z"/>
            <EventRecordID>630633515</EventRecordID>
            <Channel>Application</Channel>
            <Computer>RD281878C98595</Computer>
            <Security/>
        </System>
        <EventData>
            <Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=04F81128 [TID 12484] [PID 5864]</Data>
        </EventData>
    </Event>
    <Event>
        <System>
            <Provider Name="HttpPlatformHandler"/>
            <EventID>2000</EventID>
            <Level>4</Level>
            <Task>0</Task>
            <Keywords>Keywords</Keywords>
            <TimeCreated SystemTime="2019-10-15T12:41:31Z"/>
            <EventRecordID>630880156</EventRecordID>
            <Channel>Application</Channel>
            <Computer>RD281878C98595</Computer>
            <Security/>
        </System>
        <EventData>
            <Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=051807A0 [TID 12196] [PID 11416]</Data>
        </EventData>
    </Event>
    <Event>
        <System>
            <Provider Name="HttpPlatformHandler"/>
            <EventID>2000</EventID>
            <Level>4</Level>
            <Task>0</Task>
            <Keywords>Keywords</Keywords>
            <TimeCreated SystemTime="2019-10-15T12:41:31Z"/>
            <EventRecordID>630880734</EventRecordID>
            <Channel>Application</Channel>
            <Computer>RD281878C98595</Computer>
            <Security/>
        </System>
        <EventData>
            <Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=05841840 [TID 10740] [PID 2296]</Data>
        </EventData>
    </Event>
    <Event>
        <System>
            <Provider Name="HttpPlatformHandler"/>
            <EventID>2000</EventID>
            <Level>4</Level>
            <Task>0</Task>
            <Keywords>Keywords</Keywords>
            <TimeCreated SystemTime="2019-10-15T12:41:45Z"/>
            <EventRecordID>630894312</EventRecordID>
            <Channel>Application</Channel>
            <Computer>RD281878C98595</Computer>
            <Security/>
        </System>
        <EventData>
            <Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=05C64508 [TID 4484] [PID 7868]</Data>
        </EventData>
    </Event>
...more events here
</Events>

2 个答案:

答案 0 :(得分:1)

从Kudu cmd控制台运行应用程序通常会输出启动错误。尝试dotnet MyApp.dll

来源:https://docs.microsoft.com/en-us/aspnet/core/test/troubleshoot-azure-iis?view=aspnetcore-3.0#run-the-app-in-the-kudu-console

答案 1 :(得分:1)

结果是,我还引用了Microsoft.AspNet 2.2 NuGet程序包,该程序包在ASP.NET Core 3.0中不能很好地发挥作用。删除该依赖性解决了我的问题。