【发布时间】:2017-07-07 22:56:39
【问题描述】:
我有一个以.NetCoreApp 1.1 为目标的网站,它在本地运行良好,但无法部署我收到完全无用的错误消息:
"502.3 网关错误。尝试路由时出现连接错误 请求。”
事件查看器说"Application 'MACHINE/WEBROOT/APPHOST/MYAPP' with physical root 'C:\inetpub\MyApp' created process with command line '"dotnet" .\Web.dll' but failed to listen on port XXXX"
.net core 日志文件夹中没有任何用处,只是应用程序已启动并正在侦听。
在我安装的服务器上:
- Microsoft .Net core 1.1.1 -Runtime (x64)
- Microsoft .Net core 1.1.2 -Runtime (x64)
- Microsoft .Net 核心 1.0.5 和 1.1.2 - Windows 服务器托管
- Microsoft Http 平台处理程序 1.2
我正在使用 Web Deploy 来部署它。我检查了目录结构。我已禁用启动错误页面。它在自己的应用程序池中运行,可以访问文件系统。 CLR 版本更改为无托管代码。加载用户配置文件设置为 True。
我的程序类如下:
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
#if !DEBUG
// Disable windows auth for local debug
.UseWebListener(options =>
{
options.ListenerSettings.Authentication.Schemes = AuthenticationSchemes.NTLM;
options.ListenerSettings.Authentication.AllowAnonymous = false;
})
#endif
.UseIISIntegration()
.UseStartup<Startup>()
.UseApplicationInsights()
.Build();
编辑:在部署目录中执行 dotnet MyApp.dll 告诉我它正在侦听端口 5000。我可以在本地访问它,并且该站点现在运行良好,因此它似乎是 IIS 集成。
如何获取调试信息以找出问题所在?或者更好的是,有什么问题?
更新:当 Kestrel 尝试将 IIS 用作反向代理时,可能会被防病毒系统阻止。我还无法验证这一点。
【问题讨论】:
标签: asp.net-core