question

BorisDzevel-8348 avatar image
0 Votes"
BorisDzevel-8348 asked BorisDzevel-8348 edited

IIS AspNetCore Module V2: Failed to start application '/LM/W3SVC/1/ROOT', ErrorCode '0x8000ffff'

I have a .NET Core 3.1 Web API project that I am hosting using IIS. Project Details (see target framework):

 <Project Sdk="Microsoft.NET.Sdk.Web">
   <PropertyGroup>
     <TargetFramework>netcoreapp3.1</TargetFramework>
 ...
     <SignAssembly>true</SignAssembly>
     <AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
   </PropertyGroup>
 .....
 </Project>

I am experiencing an error in my local development environment - I'm not aware of anyone else on the team or other environments that are experiencing the same issue.

HTTP Error 500.31 - ANCM Failed to Find Native Dependencies
Common solutions to this issue:
The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found.
Troubleshooting steps:
Check the system event log for error messages
Enable logging the application process' stdout messages
Attach a debugger to the application process and inspect
For more information visit: https://go.microsoft.com/fwlink/?LinkID=2028526

203784-image.png

Event Viewer shows the following 3 errors when this occurs. Full detail in file below.

  1. Unable to locate application dependencies. Ensure that the versions of Microsoft.NetCore.App and Microsoft.AspNetCore.App targeted by the application are installed.

  2. Could not find 'aspnetcorev2_inprocess.dll'. Exception message: (BLANK - error cuts off here)

  3. Failed to start application '/LM/W3SVC/1/ROOT', ErrorCode '0x8000ffff'.

Note: Regarding aspnetcorev2_inprocess.dll error - I checked procmon for errors here and I do not see any entry for this file at all. Leads me to believe the error is misleading.
203775-image.png

203763-eventviewer.txt

I've installed the .NET Core 3.1 SDK and the Windows Hosting Bundle found here: https://dotnet.microsoft.com/en-us/download/dotnet/3.1

203764-image.png

I also have .NET SDK 5, .NET SDK 6, .NET Framework 4.6, .NET Framework 4.8 installed side-by-side. We have projects that run the gamut. I can provide specific detail here if needed.

Some version info:

Windows Version 21H2 (19044.1706)
IIS Version 10.0.19041.1

203700-image.png

I'm not sure what other troubleshooting can be done here. Any ideas?


dotnet-aspnet-core-generaldotnet-runtimedotnet-aspnet-core-webapi
image.png (57.4 KiB)
image.png (4.8 KiB)
eventviewer.txt (3.8 KiB)
image.png (402.0 KiB)
image.png (30.6 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Bruce-SqlWork avatar image
0 Votes"
Bruce-SqlWork answered

for IIS to host asp.net core, you need the physical path to be a published folder. the publish folder should have the application dll's, appsettings.json, web.config and the wwwroot folder at the root.

first create a publish folder (default is in the bin folder)

dotnet publish

then change IIS physical location to the publish folder in the bin folder


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Bruce-SqlWork avatar image
0 Votes"
Bruce-SqlWork answered

on the server run

dotnet --list-runtimes

check that 3.1 and 6/0 runtimes exist. also check the latest aspnetcore.app 3. and 6. has a matching NetCore.app version. there was a sp that broke this.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

BorisDzevel-8348 avatar image
0 Votes"
BorisDzevel-8348 answered BorisDzevel-8348 published

@Bruce-SqlWork It seems I have NetCore.App and AspNetCore.App for both of those (though I'm not using .NET 6 in this particular project) Here is the result:

 PS > dotnet --list-runtimes
 Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
 Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
 Microsoft.AspNetCore.App 3.1.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
 Microsoft.AspNetCore.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
 Microsoft.AspNetCore.App 3.1.24 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
 Microsoft.AspNetCore.App 3.1.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
 Microsoft.AspNetCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
 Microsoft.AspNetCore.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
 Microsoft.AspNetCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
 Microsoft.AspNetCore.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
 Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 3.1.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 3.1.24 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 3.1.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.WindowsDesktop.App 3.1.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
 Microsoft.WindowsDesktop.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
 Microsoft.WindowsDesktop.App 3.1.24 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
 Microsoft.WindowsDesktop.App 3.1.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
 Microsoft.WindowsDesktop.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
 Microsoft.WindowsDesktop.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
 Microsoft.WindowsDesktop.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
 Microsoft.WindowsDesktop.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Bruce-SqlWork avatar image
0 Votes"
Bruce-SqlWork answered

I'd reinstall the core module:

https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/aspnet-core-module?view=aspnetcore-6.0

the core 6 version supports 3.1 as long as the runtime is installed.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

BorisDzevel-8348 avatar image
0 Votes"
BorisDzevel-8348 answered BorisDzevel-8348 edited

I installed / uninstalled / reinstalled the .NET Core 3.1 hosting bundle multiple times as part of my troubleshooting. I haven't considered messing with .NET 6 as yet as I'm not trying to run it.

However, installing the .NET 6.0.5 hosting bundle did not resolve my issue. I noticed that I was missing the 6.0.5 version of Microsoft.WindowsDesktop.App so I even tried installing the latest .NET 6 SDK. Still no luck.

EDIT:
One interesting thing that I barely noticed - the error message SLIGHTLY changed right after I installed the 6.0.5 hosting bundle. Now it says "HTTP Error 500.31 - Failed to load ASP.NET Core runtime" instead of "ANCM Failed to Find Native Dependencies" - but it still has the same 500.31 error code. Nothing else changed. Event Viewer has no additional errors / context.

HTTP Error 500.31 - Failed to load ASP.NET Core runtime
Common solutions to this issue:
The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found.
Troubleshooting steps:
Check the system event log for error messages
Enable logging the application process' stdout messages
Attach a debugger to the application process and inspect
For more information visit: https://go.microsoft.com/fwlink/?LinkID=2028526

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Bruce-SqlWork avatar image
0 Votes"
Bruce-SqlWork answered

then most likely the build platform does not match.

use IIS and open the site basic setting. get the physical path

open a command window and check that the app runs

cd to that physical path
dir
dotnet theappname.dll

if it runs then check that dotnet is on path for system environment variables







5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

BorisDzevel-8348 avatar image
0 Votes"
BorisDzevel-8348 answered BorisDzevel-8348 edited

That path is a Visual Studio project directory, and it does run from Visual Studio (ie, in the debugger). If I navigate there in commandline, I am able to "dotnet run" the project. "dotnet" is on the system path (see screenshot). Just the fact that I can run dotnet in commandline would corroborate that, but maybe you mean SYSTEM path specifically. Yes, this is the system path specifically not just in my user path.

Note: For full transparency - for VS projects, I don't have to directly point them to the bin directory, so the DLL is directly not in the root path there as you assume (it ends up in a bin\Debug\netcoreapp3.1 directory), but this is the correct setup. I have other sites/APIs/etc running in the same way. Just not with .NET core 3.1 I guess. I did just now try to point the IIS site directly to the bin directory, but then IIS doesn't find the site at all (gives 404) so I believe it's configured correctly as-is (ie, it still errors out with my original error but it's not giving me a 404-I-Can't-Find-Your-Stuff this way).

Note2: I do have stuff running in .NET Core 3.1, just not working "InProcess" in IIS.

203818-image.png



image.png (52.9 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

BorisDzevel-8348 avatar image
0 Votes"
BorisDzevel-8348 answered BorisDzevel-8348 edited

OK. Understood. My mistake - when I tested last night, I just hit / endpoint but there's no / route in my site. Duh. I see that it's working now.

Few things for the record:
1) C:\Users\me\workspace\myrepo\myproject\bin\Debug\netcoreapp3.1 path works with IIS (publish is not necessary)
2) C:\Users\me\workspace\myrepo\myproject\bin\Debug\netcoreapp3.1\publish path also works with IIS

Apologies - this was a confusion on my end. In other (eg, .NET Framework) projects I'm running locally, I only needed to specify the "myproject" path (not \bin\Debug\etc), but as this is using a different module ASP.NET Core Module V2, I guess it has different expectations.

Thank you for the help with this! User error!

All the best.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.