Users can install and run multiple versions of the .NET Framework on their computers. When you develop or deploy your app, you might need to know which .NET Framework versions are installed on the user’s computer. Note that the .NET Framework consists of two main components, which are versioned separately:
- A set of assemblies, which are collections of types and resources that provide the functionality for your apps. The .NET Framework and assemblies share the same version number.
- The common language runtime (CLR), which manages and executes your app’s code. The CLR is identified by its own version number (see Versions and Dependencies).
We can use below PowerShell function to help determine the .NET framework versions (not CLR) installed on a machine:
function Get-FrameworkVersions() { Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse | Get-ItemProperty -name Version,Release -EA 0 | Where { $_.PSChildName -match '^(?!S)\p{L}'} | Select PSChildName, Version, Release }
Below is one of the sample runs from a OOB windows Server 2016 machine:
PSChildName Version Release
Client 4.6.01055 394271
Full 4.6.01055 394271
Client 4.0.0.0
Do note that, this does not list any .NET core versions as they are not updated in registry. Also, a list of version numbers can be found at https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/versions-and-dependencies for reference purposes.