Removing .NET Framework 4.5/4.5.1 removes Windows 2012/2012R2 UI and other features

Removing .NET Framework 4.5/4.5.1 removes Windows 2012/2012R2 UI and other features

  • Comments 30
  • Likes

This is Vimal Shekar and Krishnan Ayyer from the Windows Support team. Today in this blog, we will be discussing about an issue that we are seeing increasingly being reported in support. We will look at the effects of removing .Net Framework from a Windows Server 2012/2012 R2 installation.

Windows Server 2012 includes .NET Framework 4.5 and Windows Server 2012 R2 includes .NET Framework 4.5.1. The .NET Framework provides a comprehensive and consistent programming model to build and run applications (including Roles and Features) that are built for various platforms. Windows Explorer (Graphical Shell), Server Manager, Windows PowerShell, IIS, ASP .NET, Hyper-V, etc, are all dependent on .NET Framework. Since there are multiple OS components dependent on .Net Framework, this feature is installed by default.  Therefore, you do not have to install it separately.

It is not recommended to uninstall .NET Framework.  In some given circumstances, there may be a requirement to remove/re-install .Net Framework on Windows Server 2012/2012 R2.

When you uncheck the .NET Framework 4.5 checkbox in the Remove Roles/Features Wizard of Server Manager, Windows will check all roles/features that may also be installed as it would need to be removed as well..  If there are other roles or features dependent on .NET Framework, those would be listed in this additional window.

For Example:

image

 

If you read through the list, the components that are affected by this removal are listed as follows:

  1. .NET Framework 4.5 Features
  2. RSAT (Remote Administration Assessment Toolkit) which includes Hyper-V Management tools and Hyper-V GUI,
  3. User interfaces and Infrastructure, which includes Graphical Management Tools and Infrastructure Server Graphical Shell (Full Shell and min Shell),
  4. PowerShell which will remove complete PowerShell 4.0 and ISE

The list of components may differ depending upon the Roles and Features installed on the Server machine.  If you were to use DISM.EXE commands to remove .Net Feature, you may not even see such a list.  If you were to use PowerShell to remove .Net feature using the following command, you will not get the list.

Uninstall-WindowsFeature Net-Framework-45-Features

If you were to use Remove-WindowsFeature PowerShell cmdlet, you can add the –whatif switch to see the list of features that would also be impacted.

Remove-WindowsFeature Net-Framework-45-Features –WhatIf

Unfortunately, we all get in a hurry sometimes and we do not read through the list and click “Remove Features”. If you notice – the “Server Graphical Shell” and “Graphical Management Tools and Infrastructure” are part of the features being removed.

Here is a sample output from running Remove-WindowsFeature Net-Framework-45-Features -WhatIf. Again you will see that removing .Net Framework will effectively also remove the following:

clip_image005

The two key features that I wanted to point out are:

[User Interfaces and Infrastructure] Server Graphical Shell

[User Interfaces and Infrastructure] User Interfaces and Infrastructure

As stated earlier, this will leave the server without a graphical shell for user interaction. Only the command prompt will be available post reboot.

If you get into this situation, run the below commands in the Server Core’s command prompt window to help you recover:

DISM.exe /online /enable-feature /all /featurename:NetFx4
DISM.exe /online /enable-feature /all /featurename:MicrosoftWindowsPowerShell

The above commands will re-install .Net 4.0 and PowerShell on the server. Once PowerShell is installed, you can add the Graphical Shell (Windows Explorer) using the following command:

Install-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra

Once the GUI Shell is installed, you will need to restart the server with the following command:

Restart-Computer

NOTE:

Remove-WindowsFeature and Uninstall-WindowsFeature are aliases.  The -whatif command shows what would occur if the command was run but does not execute the command.. 

We hope this information was helpful.

Vimal Shekar
Escalation Engineer
Microsoft Support

Krishnan S Ayyer
Technical Advisor
Microsoft Support

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Nice Blog...Thanks so much...

  • A very good article, indeed! Thank you.

  • Great Information !!!

  • What if the commands to reinstall the Framework doesn't work?

  • I cannot get the command to install .net 4.0 to work either.

  • Figured it out, you must type it as:

    DISM.exe /online /enable-feature /featurename:NetFx4 /all

    Then, it will work.

  • I believe if you check you'll find RSAT is "Remote Server Administration Toolkit" (10,000 matches in google for that exact string) and not "Remote Administration Assessment Toolkit" (8 matches).

  • Very useful!!!
    Couple of typos as spotted by others, but that said it saved having to do a rebuild when application installer removed dotNet 4.5!!!

  • anyhow can
    DISM.exe /online /enable-feature /all /featurename:NetFx4

  • Path to Powershell.
    C:\Windows\System32\WindowsPowerShell\v1.0

    Also if you do what I did and close the dos window, you can restart the server from another server by running the following from a remote server. This will bring the dos window back.

    Restart-Computer -ComputerName [ServerName] -Force

  • hello,

    DISM.exe /Online /Enable-Feature /Featurename:NetFx4 /All
    DISM.exe /Online /Enable-Feature /Featurename:MicrosoftWindowsPowerShell /All

    from cmd, type: start powershell (to launch PS)
    enter the following command;

    Install-WindowsFeature Server-Gui-Shell
    Install-WindowsFeature Server-GuiMgmt-Infra

  • Thanks. Simple and Meaningful

  • Its really Great Information .
    se below syntax of command.
    DISM.exe /online /enable-feature / all /featurename:NetFx4
    DISM.exe /online /enable-feature /all /featurename:MicrosoftWindowsPowerShell

  • The DISM commands have been fixed in the blog now. Thanks everyone for bringing it to our attention

  • Great blog. Verry helpful. Thank you