Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'Bad Gateway' error when loading aspnetcore RC2 default website project

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

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.

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

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

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.

The event viewer states:

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%"

in web.config with the required values

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

(update: these placeholders are replaced when you publish)

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

Running from the command line via dotnet works

Wondering what to try now.

like image 830
wal Avatar asked May 21 '16 11:05

wal


1 Answers

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.

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

like image 186
wal Avatar answered Oct 27 '22 04:10

wal