31

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

My question is when running .NET code in this IIS site, which framework version is it using: 4.0 or 4.5 ?

Please see below screen shots.

inetmgr screenshot

installed programs screenshot

Willem Van Onsem
  • 443,496
  • 30
  • 428
  • 555
Shakeer Hussain
  • 2,230
  • 7
  • 29
  • 52

2 Answers2

58

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

Update Feb 2020:

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

ryancdotnet
  • 2,015
  • 16
  • 33
  • Your code is running as it was deployed/installed, in .NET Framework version 4.5. Your IIS AppPool is configured correctly to support it. – ryancdotnet Jun 21 '16 at 19:55
  • Okay, The problem is the TEST server having Framework 4.5 and IIS AppPool is 4.0, in this server TLS v.1 protocol is working fine. – Shakeer Hussain Jun 21 '16 at 20:06
  • but in Stage server have Framework 4.0 client profile and IIS AppPool is 4.0, in this server TLS V.1 protocol was not supporting. When i googled it i found answers to upgrade Stage server Framework 4.0 to 4.5 version – Shakeer Hussain Jun 21 '16 at 20:07
  • While this contains useful information, it does not directly answer the question itself. Based on the second screen shot and the time stamp of the question, this machine is likely to have .NET Framework 4.5.1 installed (can be verified via https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed), so **IIS uses that .NET Framework version (the latest 4.x version installed on the machine) to run the application pool (to match CLR v4.0)**. – Lex Li Feb 15 '23 at 06:54
12

Follow the below steps to get the .Net Version Used by IIS.

  1. Open IIS Manager. For information about opening IIS Manager, see Open IIS Manager (IIS 7).
  2. On the Connections pane, expand the server node and click Application Pools.
  3. On the Application Pools page, select the application pool for which you want to specify a .NET Framework version, and then click Basic Settings in the Actions pane.
  4. In the Edit Application Pool dialog box, in the .NET Framework version list, Check the version of .Net Framework. -> Get this version
  5. Navigate to the Directory and check the details of the clr.dll-> C:\Windows\Microsoft.NET\Framework64\Version_got_from_step_4\clr.dll

Versions of .Net above 4.0 are being upgraded as in-place and the installed version can be checked in the registry path - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\release or version

Maheswaran j
  • 121
  • 1
  • 2