.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.
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:
(Source: https://msdn.microsoft.com/en-us/library/8bs2ecf4(v=vs.110).aspx#Anchor_0)
So having a .NET CLR Version of 4.0 just means you support the above Frameworks, which will run under their deployed framework version.
Follow the below steps to get the .Net Version Used by IIS.
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