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

Boris Dzevel 21 Reputation points
2022-05-19T15:05:55.903+00:00

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?

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,622 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,168 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 66,866 Reputation points
    2022-05-20T00:40:37.427+00:00

    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


10 additional answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 66,866 Reputation points
    2022-05-19T15:14:10.923+00:00

    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.

    0 comments No comments

  2. Boris Dzevel 21 Reputation points
    2022-05-19T18:02:58.26+00:00

    @Bruce (SqlWork.com) 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]  
    
    0 comments No comments

  3. Bruce (SqlWork.com) 66,866 Reputation points
    2022-05-19T20:03:33.017+00:00

    I'd reinstall the core module:

    https://learn.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.

    0 comments No comments

  4. Boris Dzevel 21 Reputation points
    2022-05-19T20:55:25.393+00:00

    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

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.