在 IIS 中部署 .NET Core RC2 时出现服务器错误 502

Server error 502 when deploying .NET Core RC2 in IIS

我在 Mac 上使用 VS Code 中的 .NET Core RC2 开发了一个 MVC 网站,并尝试将其部署在 Windows Server 2012 R2 IIS 中。我使用 https://docs.asp.net/en/latest/publishing/iis.html 作为参考。我的 project.json 有 Microsoft.AspNetCore.Server.IISIntegrationMicrosoft.AspNetCore.Server.Kestrel。我的 startup.cs 有 app.UseStaticFilesapp.UseSessionapp.UseMVC

我做到了

我收到以下错误

502 - Web server received an invalid response while acting as a gateway or proxy server. There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.

我做错了什么?

根据 cesarbs 提示我做了一个 dotnet publish,将生成的文件夹复制到网站根目录并回收了应用程序池。效果很好。