Windows – Health-Check on .NET 4.5 Installation

netpowershellwindowswindows-server-2012-r2

On a Windows Server 2012 R2 Core Server box, I get these results:

PS C:\Users\vagrant> Get-WindowsFeature | Where-Object {$_.DisplayName -like "*.NET*"}

Display Name                                            Name                       Install State
------------                                            ----                       -------------
    [ ] .NET Framework 4.5                              AS-NET-Framework                 Removed
            [ ] .NET Extensibility 3.5                  Web-Net-Ext                    Available
            [ ] .NET Extensibility 4.5                  Web-Net-Ext45                  Available
            [ ] ASP.NET 3.5                             Web-Asp-Net                    Available
            [ ] ASP.NET 4.5                             Web-Asp-Net45                  Available
[ ] .NET Framework 3.5 Features                         NET-Framework-Features         Available
    [ ] .NET Framework 3.5 (includes .NET 2.0 and 3.0)  NET-Framework-Core               Removed
[X] .NET Framework 4.5 Features                         NET-Framework-45-Fea...        Installed
    [X] .NET Framework 4.5                              NET-Framework-45-Core          Installed
    [ ] ASP.NET 4.5                                     NET-Framework-45-ASPNET        Available
    [ ] .NET Environment 3.5                            WAS-NET-Environment            Available

I don't know how to interpret the above report. Is .NET framework 4.5 installed, or not installed? How can ".NET 4.5 features" be "installed", but ".NET 4.5" is "removed"?

The registry entries for .net on this same machine look like this:

enter image description here

Based on the this MSDN article, presumably I have .NET Framework 4.5.1 installed. But still, how should I interpret the first report above? It seems to suggest that my .NET 4.5 install is incomplete.

And it gets worse. Consider this output:

PS C:\Users\vagrant> $psversiontable

Name                           Value
----                           -----
PSVersion                      4.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.33440
BuildVersion                   6.3.9600.16384
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion      2.2

This looks like it conflicts with both the reports above. 🙁

Best Answer

If you run Get-WindowsFeatures without the filter, you'll see that "AS-Net-Features" is part of "Application Server". As SimonS says, it's only needed if you're hosting applications on that server, not for running .NET-based apps. NET-Framework-Core is the actual .NET framework, which is installed.

$PSVersionTable.PSversion lists the version of PowerShell installed, not the .NET Framework. PowerShell is part of the Windows Management Framework (WMF), each version of which has a dependency of a version of .NET Framework, but they're not like-for-like. For instance, WMF 5 needs .NET 4.5 or above.

As to what version of .NET Framework you have installed, this is an incomplete picture. It tells us that you have .NET 4.5.1 installed (which comes with Windows), which fills any requirement of .NET 4.0 - 4.5.1. It also tells us that you don't have .NET Framework 3.5, which is how you get lower version .NET Framework support as well. However, there have been a few .NET Frameworks released since then (4.5.2, 4.6, and 4.6.1), and if you installed them, they'd be in the installed programs list, not Windows Features.

There is a tool I actually just found recently that can help determine what version is on a given system, although being a GUI program, I'm not sure it'd help on a Server Core install. It's called the .NET Framework Setup Verification Tool, and can be found here: https://blogs.msdn.microsoft.com/astebner/2008/10/13/net-framework-setup-verification-tool-users-guide/