.NETFramework version used at runtime

Heiko 1,211 Reputation points
2022-08-09T11:48:17.37+00:00

I have a WPF desktop bridge app. I have set the TargetFrameworkVersion to 4.6.1. Now when this app is installed on a PC that has .NETFramework versions 4.7 and 4.8 installed, which .NETFramework version is used to run the app? Will the next higher version, 4.7, or the highest, 4.8, be used?

Or is always the version used which is according to this link in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\Release?

The background of my question is that I want to run code depending on the .NETFramework version, since the app seems to behave differently between 4.6.1 and 4.8 regarding DPI awareness.

What if 4.6.1 or higher is not installed, but e.g. only 4.5.2 ?

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,669 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,223 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,118 questions
0 comments No comments
{count} vote

Accepted answer
  1. Bruce (SqlWork.com) 55,366 Reputation points
    2022-08-09T15:04:42.21+00:00

    The 4.* framework updates in place, so there is only one version installed. In 4.8 is installed, then it runs on 4.8

    The app is built with the lowest supported version. So if a 4.6.1 app is run on a computer with only 4.5.2 it will give a warning to install the update.

    Note: this different than .net core where updates are installed side by side, and the app requires a matching major and minor.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful