1

So let's say I have my app pool set for "4.0.30319". In Visual Studio, my project settings are set for ".NET Framework 4.6.2".

In my web.config, there is a line:

<httpRuntime targetFramework="4.5" maxRequestLength="30720" executionTimeout="36000"/>

And 4.8 is actually installed on the server running ISS.

Now lets say there was a change in behavior shipped in, say, 4.7. Will I see the new behavior in my application?

Kerry Thomas
  • 119
  • 6
  • The final runtime is 4.8 as you installed on the server, so all behaviors should match 4.8. All other settings only limit the compiler from using a newer profile, https://blog.lextudio.com/the-rough-history-of-referenced-assemblies-7d752d92c18c Please ignore your application pool setting, as IIS should say "CLR version" instead. – Lex Li Apr 29 '20 at 21:16

1 Answers1

3

According to the docs:

If the version of the .NET Framework that the application was built against is present on the computer, the application runs on that version.

If the version of the .NET Framework that the application was built against is not present and a configuration file does not specify a version in a Element, the application runs on the latest version of the .NET Framework that is present on the computer.

If the version of the .NET Framework that the application was built against is not present and the configuration file specifies a version in a Element, the application runs on the latest version that is specified in the application configuration file and is present on the computer.

So I would say 4.8, You can always check it programmatically using:

Environment.Version

Additionaly check out this question.

Community
  • 1
  • 1
romfir
  • 394
  • 3
  • 6
  • Environment.Version doesn't directly tell you which version of .NET Framework is used. It tells you which version of the CLR is used. To get the .NET Framework version based on Environment.Version, read: https://stackoverflow.com/questions/12971881/how-to-reliably-detect-the-actual-net-4-5-version-installed/12972517#12972517 – Astrophe Feb 11 '21 at 16:04