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,149 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,118 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 55,366 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) 55,366 Reputation points
    2022-05-19T21:40:16.427+00:00

    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

    0 comments No comments

  2. Boris Dzevel 21 Reputation points
    2022-05-19T22:49:43.137+00:00

    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

    0 comments No comments

  3. Boris Dzevel 21 Reputation points
    2022-05-20T14:24:39.647+00:00

    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.

    0 comments No comments

  4. Eduardo Santos 0 Reputation points
    2023-10-20T17:17:38.58+00:00

    I had this same issue with configuration:

    Architecture: x64

    Framework: 'Microsoft.NETCore.App', version '7.0.0' (x64)

    Windows Server 2019 / IIS

    The Framework was installed (checked with "dotnet --info") - none of the solutions found fixed this. Then I've changed web.config based on another Blazor Server project (which worked at first time).

    Problem: Visual Studio 2022 published this file with this content:

    <aspNetCore processPath=".\MyAppHosted.Server.exe"

    Solution: The solution in my case: I've changed this for:

    <aspNetCore processPath="dotnet" arguments=".\MyAppHosted.Server.dll"