简体   繁体   English

IIS 出现“HTTP 错误 500.30 - ASP.NET Core 应用程序无法启动”

[英]“HTTP Error 500.30 - ASP.NET Core app failed to start” with IIS

I deployed a API .NET Core 5 service with the Publish feature.我部署了一个具有发布功能的 API .NET Core 5 服务。 When I start the service with cmd with command dotnet <service-name>.dll , it runs but I cannot make API request.当我使用 cmd 和命令dotnet <service-name>.dll启动服务时,它运行但我无法发出 API 请求。 When I start it with IIS, it shows me the following error当我用 IIS 启动它时,它显示了以下错误

HTTP Error 500.30 - ASP.NET Core app failed to start

Common solutions to this issue:
- The app failed to start
- The app started but then stopped
- The app 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

I searched around the internet this error, but I didn't find a solution for my problem.我在互联网上搜索了这个错误,但没有找到解决我的问题的方法。 This is my program.cs这是我的program.cs

public static IHostBuilder CreateHostBuilder(string[] args) =>
    Host.CreateDefaultBuilder(args)
        .ConfigureWebHostDefaults(webBuilder =>
        {
            webBuilder
            .UseNLog()
            //.UseContentRoot(Directory.GetCurrentDirectory())
            .UseKestrel()
            .UseIISIntegration()
            .UseStartup<Startup>();
            //.Build();
        });

Errors from EventViewer来自事件查看器的错误

.NET Runtime .NET 运行时

Application: w3wp.exe
CoreCLR Version: 5.0.721.25508
.NET Version: 5.0.7
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException: Application is running inside IIS process but is not configured to use IIS server.
   at Microsoft.AspNetCore.Server.IIS.Core.IISServerSetupFilter.<>c__DisplayClass2_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
   at LogService.Program.Main(String[] args) in C:\DEV\LogService\LogService.API\Program.cs:line 19

IIS AspNetCode Module V2 IIS AspNetCode 模块 V2

Application '/LM/W3SVC/2/ROOT' with physical root 'C:\LogService\' hit unexpected managed exception, exception code = '0xe0434352'. First 30KB characters of captured stdout and stderr logs:
crit: Microsoft.AspNetCore.Hosting.Diagnostics[6]
      Application startup exception
      System.InvalidOperationException: Application is running inside IIS process but is not configured to use IIS server.
         at Microsoft.AspNetCore.Server.IIS.Core.IISServerSetupFilter.<>c__DisplayClass2_0.<Configure>b__0(IApplicationBuilder app)
         at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
         at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
Unhandled exception. System.InvalidOperationException: Application is running inside IIS process but is not configured to use IIS server.
   at Microsoft.AspNetCore.Server.IIS.Core.IISServerSetupFilter.<>c__DisplayClass2_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
   at LogService.Program.Main(String[] args) in C:\DEV\LogService\LogService.API\Program.cs:line 19

Application '/LM/W3SVC/2/ROOT' with physical root 'C:\LogService\' failed to load coreclr. Exception message:
CLR worker thread exited prematurely

It works with current configuration它适用于当前配置

public static IHostBuilder CreateHostBuilder(string[] args) =>
        Host.CreateDefaultBuilder(args)
            .ConfigureWebHostDefaults(webBuilder =>
            {
                webBuilder
                .UseNLog()
                //.UseContentRoot(Directory.GetCurrentDirectory())
                //.UseKestrel()
                .UseIISIntegration()
                .UseIIS()
                .UseStartup<Startup>();
                //.Build();
            });

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 IIS .NET Core 5.0 MVC API - 获取 HTTP 错误 500.30 - ASP.NET Core 应用程序无法启动 - IIS .NET Core 5.0 MVC API - Getting HTTP Error 500.30 - ASP.NET Core app failed to start BouncyCastle 部署错误:HTTP 错误 500.30 - ASP.NET 核心应用程序无法启动 - BouncyCastle deployment error: HTTP Error 500.30 - ASP.NET Core app failed to start 覆盖默认错误页面 500.30 - ASP.NET 核心应用程序无法启动 - Override the default error page 500.30 - ASP.NET Core app failed to start 500.30 - ASP.NET Core 应用无法在 Visual Studio 中开始运行 - 500.30 - ASP.NET Core app failed to start running in Visual Studio ASP.NET 核心 3.1 - HTTP 错误 500.30 - ANCM 进程中启动失败 - ASP.NET Core 3.1 - HTTP Error 500.30 - ANCM In-Process Start Failure IIS 和 NET Core HTTP 错误 500.30 - ANCM 进程中启动失败 .net 核心 3.1 - IIS and NET Core HTTP Error 500.30 - ANCM In-Process Start Failure .net core 3.1 ASP.NET 核心 3.0 - InProcess 与 OutOfProcess(HTTP 错误 500.30 - ANCM 进程内启动失败) - ASP.NET Core 3.0 - InProcess vs. OutOfProcess (HTTP Error 500.30 - ANCM In-Process Start Failure) .NET 核心托管到 IIS,我收到 HTTP 错误 500.30 - ANCM 进程内启动失败 - .NET Core hosting to IIS, I get HTTP Error 500.30 - ANCM In-Process Start Failure HTTP 错误 500.30 - ANCM 进程中启动失败 Asp.net-Core 3.1 - HTTP Error 500.30 - ANCM In-Process Start Failure Asp.net-Core 3.1 Azure appservice 返回错误 500.30 但我的应用在 kudu (ASP.NET Core) 上运行良好 - Azure appservice returns error 500.30 but my app runs well on kudu (ASP.NET Core)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM