通过IIS

时间:2018-01-16 16:39:47

标签: iis asp.net-core .net-core

我无法通过IIS部署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();

我在Startup.cs中使用以下设置:

services.Configure<IISOptions>(options =>
{
    options.AutomaticAuthentication = true;
});

1 个答案:

答案 0 :(得分:1)

该错误可能有多种原因。

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