"Bad Gateway" error loading default aspnetcore RC2 website project

I am trying to run a standard ASP.NET Core web application (web application template in VS 2015) through IIS.

I followed the instructions from the docs here , for example, creating the application pool "Without Managed Code" and pointing to the physical path in the location of the web.config .

When I try to go to the root site, http://localhost I get this error:

HTTP Error 502.3 - Bad Gateway A connection error occurred while trying to route the request.

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

Event Viewer:

The process could not be started using the command line 'dotnet./bin/Debug/netcoreapp1.0/WebApplication2.dll', error code = '0x80004005'.

This error shows that I 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 published)

Following the troubleshooting instructions, I installed the .NET Core Windows Server Hosting Bundle and restarted the server.

Running from the command line via dotnet works

I wonder what to try now.

+8
asp.net-core .net-core-rc2
May 21 '16 at 11:13
source share
2 answers

Ok, I understood my problem. I am pointing the physical path in IIS to the unpublished project root directory. This works in previous versions of .net (i.e., aspnet projects without dotnet core), but does not.

If you really want this to work, you should publish your application in a temporary folder and copy the Microsoft.AspNetCore.* runtimes back to the bin\Debug\ folder along with the refs and runtimes

+3
May 21 '16 at 11:55
source share

This is a common mistake when IIS cannot find the specified .NET Core components and does not know where to forward requests. In addition to the next official edition of IIS , make sure you have:

  • Correct versions installed from download page for latest .NET Core releases
  • Correct library versions defined (explicitly or using wildcards) in project.json
  • The web.config file is included (preferably using the publish-iis tool) and that the values โ€‹โ€‹of the <aspNetCore> key have been replaced with local values โ€‹โ€‹( source, with examples )

I came across this by installing the primary server 1.0.0 (final) on the new Windows 2008 Server. It turns out that I confused some installers from my machine with newer versions and had inappropriate versions of the library (RC2 vs final). The problem with reinstalling the server hosting package has been fixed.

The key to troubleshooting was to log into the console and use dotnet (and the resulting error messages) to repeat the iteration until my site was launched from the console, as the IIS error page in the browser was useless. I also found several advantages in several entries in the system error logs, but not many.

0
Sep 13 '16 at 21:58
source share



All Articles