Teoman shipahi
Teoman shipahi

Reputation: 23042

IIS 10 App Pool Keeps Stopping due to aspnetcore.dll failed to load

I have an asp.net core 2.0 hosted locally on IIS 10. For some reason DefaultAppPool keeps stopping as soon as I hit the hosted website. And I am getting HTTP Error 503. The service is unavailable.

In event logs I see following error;

The Module DLL C:\WINDOWS\system32\inetsrv\aspnetcore.dll failed to load. The data is the error.

When I check the path C:\WINDOWS\system32\inetsrv\ I do not see aspnetcore.dll exists. Should it be there? If yes, .net core installation exe shouldn't be copy it?

Here are some information below;

core installed

IIS App Pool

Event Logs

intesrv

What I tried, and did not worked?

  1. Troubleshooting IIS AppPool crashes
  2. Uninstalled .net core and reinstalled.
  3. Changed App Pool Identity to Network Service etc.

Any idea how I can fix this?

Upvotes: 1

Views: 8730

Answers (5)

Hugo A.
Hugo A.

Reputation: 355

This issue may happen if setting up a new windows machine with IIS and then restoring it's previous settings and configurations. The module aspnetcore.dll is not used anymore and even installing the latest version of Dotnet Hosting Bundle will not solve the issue because that file is not installed anymore. The new IIS module version AspNetCoreModuleV2 and the installed file is aspnetcorev2.dll and usually, is installed in the "%ProgramFiles%\IIS\Asp.Net Core Module" folder.

The solution is to edit applicationhost.config inside the C:\Windows\System32\inetsrv\config folder and remove all references to the old dll. Also in IIS, check the Modules for each website and remove any reference to the old module as well.

Restart IIS and the issue should be solved. If not, check the Windows Event Viewer to check if the error "The Module DLL C:\WINDOWS\system32\inetsrv\aspnetcore.dll failed to load." still happens.

Upvotes: 0

Jomy John
Jomy John

Reputation: 6508

I got this issue one time. Reason was Server OS was x64 base and target run time of installer was win-x86. In the publish wizard, win-x86 is the default option for Target Run time. Theoretically x86 application should work in x64. But after deploying the win-x64 , issue resolved.

Upvotes: 1

housen shafiee
housen shafiee

Reputation: 11

I also had this problem in Windows server 2012 R2

I found this answer: ASP.NET Core/.NET Core: Runtime & Hosting Bundle (latest versions) depends on Microsoft Visual C++ 2015 Redistributable

  1. Download and install KB2919442
  2. Run windows update, which will download and install KB2919335. Alternatively manually download and install KB2919335
  3. Install Visual Studio 2015 C++ Redistributable

Upvotes: 1

Pankaj Kapare
Pankaj Kapare

Reputation: 7792

For hosting .Net Core applications in IIS, .Net CLR Version of application pool should be No Managed Code as shown in below screenshot. If you don't see "No Managed Code" option in in dropdown then you need to install .Net Core Hosting Bundle. enter image description here

Upvotes: 2

Mohsin Mehmood
Mohsin Mehmood

Reputation: 4236

Ensure you have .NET Core Hosting Bundle installed as mentioned here: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-2.1&tabs=aspnetcore2x

Upvotes: 1

Related Questions