代码之家  ›  专栏  ›  技术社区  ›  SBFrancies

部署ASP。通过IIS的Net Core web应用程序

  •  0
  • SBFrancies  · 技术社区  · 7 年前

    部署ASP时遇到问题。Net Core 2.0 web应用程序。我的应用程序通过VS构建和运行,但我无法使IIS实例正常工作。

    我收到以下错误消息:

    HTTP Error 502.5 - Process Failure 
    
    Common causes of this issue: 
    
    - The application process failed to start 
    - The application process started but then stopped 
    - The application process started but failed to listen on the configured port 
    

    所有故障排除步骤均不起作用。当我通过命令行运行以下命令时,我认为问题不在于应用程序本身:

    "C:\Program Files\dotnet\dotnet.exe" C:\inetpub\wwwroot\MyApp\MyApp.dll
    

    应用程序正在运行,我可以在 http://localhost:5000/

    我已经完成了 https://docs.microsoft.com/en-gb/aspnet/core/host-and-deploy/iis/index?tabs=aspnetcore1x#common-errors 仍然没有取得任何进展。

    这就是我的WebHostBuilder方法的外观:

    var host = new WebHostBuilder()
                  .UseKestrel()
                  .UseContentRoot(Directory.GetCurrentDirectory())
                  .UseIISIntegration()
                  .UseStartup<Startup>()
                  .UseApplicationInsights()
                  .Build();
    host.Run();
    

    我在启动时使用以下设置。反恐精英:

    services.Configure<IISOptions>(options =>
    {
        options.AutomaticAuthentication = true;
    });
    
    1 回复  |  直到 7 年前
        1
  •  1
  •   Nick    7 年前

    这种错误可能有多种原因。

    1. 在IIS服务器上是否安装了 .Net Core Runtime ?
    2. 您的应用程序池配置是否正确?
    3. 您的站点绑定是否正确? enter image description here
    4. 检查计算机上的安装运行时是否与您尝试在项目上运行的运行时相同 enter image description here