【发布时间】:2018-01-16 16:39:47
【问题描述】:
我无法通过 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;
});
【问题讨论】:
-
你安装了 .NET Core Hosting Bundle 吗:aka.ms/dotnetcore-2-windowshosting ?
-
安装托管包后是否完全重启了机器?
-
是的,完全重启并重启 IIS。
标签: iis asp.net-core .net-core