Hosting application targeting multiple framework

If the application is targeting multiple frameworks e.g. NET Core 2.1 and .NET Framework 4.6.1, you will need to install Hosting Bundle for it. Here is how;

https://dotnet.microsoft.com/en-us/download/dotnet/2.1

Restart your IIS box.

Make sure App poll is using v4.0 of .NET CLR version.

This will also help to solve this error;

IIS: Handler “aspNetCore” has a bad module “AspNetCoreModuleV2” in its module list

Version of .Net Framework, IIS App Pool is using?

.Net Framework 4.5 was installed on my machine and on the IIS Application Pool, I set the .NET CLR version to 4.0.

The AppPool’s .NET CLR Version is different from the .NET Framework Version.

The AppPool’s .NET CLR Version is different from the .NET Framework Version.

The .NET CLR Version 4.0 is the CLR base for the following .NET Framework Versions:

  • 4
  • 4.5 (including 4.5.1 and 4.5.2)
  • 4.6 (including 4.6.1 and 4.6.2 Preview)

So having a .NET CLR Version of 4.0 just means you support the above Frameworks, which will run under their deployed framework version.

Source: https://learn.microsoft.com/en-us/dotnet/standard/clr#clr-versions

Here is a full mapping of CLR to .NET Framework versions, based off this official documentation. https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/versions-and-dependencies#version-information

CLR 1.0

.NET Framework 1.0


CLR 1.1

.NET Framework 1.1


CLR 2.0

.NET Framework 2.0

.NET Framework 3.0

.NET Framework 3.5


CLR 4

.NET Framework 4

.NET Framework 4.5

.NET Framework 4.5.1

.NET Framework 4.5.2

.NET Framework 4.6

.NET Framework 4.6.1

.NET Framework 4.6.2

.NET Framework 4.7

.NET Framework 4.7.1

.NET Framework 4.7.2

.NET Framework 4.8

Reference

https://stackoverflow.com/questions/37952860/which-version-of-the-net-framework-is-iis-using-for-my-apppool