.NET Core app runs locally on web server, but not accessible via remote browser

1

I have an ASP.NET Core 1.1 web app which I've published to a remote server.

I've set the website up in IIS following these instructions. I know the bindings and firewall etc are configured right because before I installed the .NET Core app I could browse to the binding URL and see the IIS default page.

After adding the .NET Core application to the website directory, browsing to the same URL just returns a HTTP Error 502.5 - Process Failure error. However, if I run the application in a command prompt locally on the server (running dotnet .\MyProject.dll) it reports that the application started OK. At this point I can browse to the site locally on http://localhost:5000 and it works correctly.

So I assume this is an issue with my IIS setup. What might I have missed? I've installed the ASP.NET Core 1.1.1 Hosting Package. The application pool user has modify permission on my application directory and read permission on C:\program files\dotnet. The app pool is configured for no managed code. Clearly the runtime is correctly installed or it wouldn't work locally. Unfortunately the server's event viewer is not very helpful, just gives me:

Application 'MACHINE/WEBROOT/APPHOST/MYPROJECT' with physical root 'C:\Sites\MyProject\' failed to start process with commandline 'dotnet .\MyProject.dll', ErrorCode = '0x80070002 : 0

Any assistance would be very appreciated.

UPDATE 1

I hadn't long posted this when I found this on SO. One of the unaccepted answers suggested changing "dotnet" to "C:\Program Files\dotnet\dotnet.exe" in the web.config to end up with this:

<aspNetCore processPath="C:\Program Files\dotnet\dotnet.exe" arguments=".\Picsolve.Web.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />

This fixed the problem! Can anyone explain why this ight have been? I've checked my system environment variables and can see C:\Program Files\dotnet in there.

c#
asp.net
iis
asp.net-core
asked on Stack Overflow Oct 13, 2017 by Tom Troughton • edited Oct 13, 2017 by Tom Troughton

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0