加载aspnetcore RC2默认网站项目时出现“错误网关”错误 [英] 'Bad Gateway' error when loading aspnetcore RC2 default website project

查看:153
本文介绍了加载aspnetcore RC2默认网站项目时出现“错误网关”错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过IIS运行默认的ASP.NET Core Web应用程序(VS 2015中的Web应用程序模板)。

I am attempting to run the default ASP.NET Core Web Application (Web Application Template in VS 2015) via IIS.

我已按照文档中的说明进行操作此处,例如,设置无托管代码应用程序池并指向 web.config 文件所在位置的物理路径。

I have followed the instructions from the docs here eg setting up a 'No Managed Code' application pool and pointing the Physical Path at the location of the web.config file.

当我尝试浏览到网站根目录时, http:// localhost 我收到此错误:

When I attempt to browse to the website root, http://localhost I am getting this error:



HTTP错误502.3-错误的网关尝试路由请求时出现连接错误。

HTTP Error 502.3 - Bad Gateway There was a connection error while trying to route the request.

最可能的原因:CGI应用程序未返回一组有效的
HTTP错误。由于父网关中的错误,充当代理或网关的服务器无法
处理请求。

Most likely causes: The CGI application did not return a valid set of HTTP errors. A server acting as a proxy or gateway was unable to process the request due to an error in a parent gateway.

事件查看器指出:


无法使用命令行 dotnet ./bin/Debug/netcoreapp1.0/WebApplication2.dll启动进程,错误代码='0x80004005'。

Failed to start process with commandline 'dotnet ./bin/Debug/netcoreapp1.0/WebApplication2.dll', Error Code = '0x80004005'.

此错误表明我已替换了占位符

This error shows I have replaced the placeholders

<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%"

web.config 中具有必需的值

<aspNetCore processPath="dotnet" arguments="./bin/Debug/netcoreapp1.0/WebApplication2.dll"

更新:发布时将替换这些占位符)

(update: these placeholders are replaced when you publish)

根据故障排除说明,我已安装 .NET Core Windows Server主机捆绑包并重新启动服务器。

As per the troubleshooting instructions I have installed .NET Core Windows Server Hosting Bundle and restarted the server.

通过 dotnet 从命令行运行有效

想知道什么立即尝试。

推荐答案

好,我知道了我的问题。我将IIS中的物理路径指向未发布的 Visual Studio项目根目录。

Ok I figured my issue out. I am pointing the physical path in IIS to the unpublished Visual Studio project root directory. This works in previous versions of .net (ie non dotnet core aspnet projects) but doesnt now.

如果确实希望此功能正常工作,则必须将应用程序发布到.net。一个临时文件夹,然后将 Microsoft.AspNetCore。* 二进制文件复制到 bin\Debug\ 文件夹中 refs runtimes 文件夹

If you really want this to work then you have to publish your app to a temporary folder and copy the Microsoft.AspNetCore.* binaries back into the bin\Debug\ folder along with the refs and runtimes folders

这篇关于加载aspnetcore RC2默认网站项目时出现“错误网关”错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆