IIS Returns HTTP Error 503: Service Unavailable

IIS stops working with a 503 Service Unavailable error.


After uninstalling .NET Core 2.2, Internet Information Server (IIS) stops working with the error

503 Service unavailable

The Windows Event Viewer reports that it was unable to load C:\Program Files (x86)\IIS\Asp.Net Core Module\V2\aspnetcorev2.dll.

This issue occurs because the .NET Core installer that added aspnetcorev2.dll is the installer that will remove it. However, all .NET Core or .NET 5+ installers will add the DLL if they are the first installation. 


Quick Fix

Reinstall .NET Core 2.2 to restore the missing DLL. *

  1. Go to https://dotnet.microsoft.com/en-us/download/dotnet/2.2
  2. Download and install version 2.2.8 of the Web Hosting Bundle.
  3. Restart IIS.

Correct Fix

Edit the IIS configuration file and remove the reference to the missing DLL.

  1. Backup the file C:\WINDOWS\system32\inetsrv\config\applicationHost.config.
  2. Edit the file applicationHost.config to remove the line that looks like this:

    <add name="AspNetCoreModuleV2" image="%ProgramFiles%\IIS\Asp.Net Core Module\V2\aspnetcorev2.dll" />

  3. Restart IIS.

* Note: TASKE version 2022.2 has updated the .NET version to the supported 6.0 version. Please contact support for information about acquiring the upgrade.

Useful links