ASP.NET Core app build to target Core 2.1 fails on IIS 10 server where Core 2.1 is installed

2

I have just setup up IIS 10 on a clean Server 2016 hosted server, and installed the following packages that I have gleaned should be on the machine to allow IIS to host ASP.NET Core applications:

aspnetcore-runtime-2.1.0-win-x64.exe
dotnet-hosting-2.1.0-win.exe
dotnet-runtime-2.1.0-win-x64.exe

I have installed my app straight into the Default Web Site and replaced all files in C:\inetpub\wwwroot\ with my app files. I also did assign the web site an app pool with no managed code, so that isn't my problem.

Last time my app was built with 2.0, and I installed the latest versions of the above packages, which I'm sure was 2.0, and the only error I had was that the command dotnet that IIS uses to invoke Kestrel to run the site, was not in the PATH env. variable

Now when I try and browse to localhost on the Server 2016 machine, it gives me the following error, found in the Windows event log:

Application 'MACHINE/WEBROOT/APPHOST/DEFAULT WEB SITE' with physical root 'C:\inetpub\wwwroot\' failed to start process with commandline 'dotnet .\QuickDrive.Mvc.dll', ErrorCode = '0x80004005 : 8000808c.

Initially I tried with the same build as before, which was 2.0, and when I got this error, I rebuilt the app to target 2.1. Nearly every search result and relevant SO answer I can find suggest a version conflict, but now there should at least be no version conflict between the runtime and hosting package on the server. Maybe there are other version conflicts I am not aware of though?

At very least I'm asking for some advice on how to get more detailed diagnostic information, even if I don't get an answer that tells me straight what config options and versions to check on Windows and on IIS.

iis
asp.net-core
.net-core
asp.net-core-mvc
asp.net-core-2.0
asked on Stack Overflow Jun 13, 2018 by ProfK • edited Jun 14, 2018 by ProfK

3 Answers

2

You have to install the Core SDK for whatever version you want to target in Visual Studio. Installing the runtime alone won't do the trick. You may have the restart Visual Studio afterward to see it in the list.

Here is a link to the SDK 2.1 download (the latest as of this writing).

answered on Stack Overflow Jun 13, 2018 by R. Richards
1

I solved the problem by running dotnet myWesite.dll in PowerShell, and first I found that dotnet.exe was not in the PATH environment variable, and after fixing that, running dotnet myWesite.dll again gave me a meaningful error message that an assembly was missing because it had not been included when I published the website.

answered on Stack Overflow Jun 17, 2018 by ProfK
0

I faced the same error on the dev machine in IIS Express. MVC App stopped working all of the sudden. Eventlog gave the 0x80004005 error code.

After trying multiple suggestions, the solution to debug the wired error code was to run the app in the console:

[Project bin folder]> dotnet [projectname].dll

It appeared that during the NuGet package update, the dotnet core version was accidentally updated to 2.1.4 where as the installed version was 2.1.3 [could be a bug in Nuget manager as the update was from there]

I edited the project file to reference the available version (2.1.3) and the app started to work properly.

answered on Stack Overflow Sep 15, 2018 by BiLaL

User contributions licensed under CC BY-SA 3.0