Install .NET Framework 4 (or 4.6) in Windows Server 2016

8

3

I was trying to test our products to make sure that they are compatible with Windows Server 2016. And during some testing, I mistakenly thought that I can simply "downgrade" .NET framework from 4.6 to 4. So I removed .NET 4.6 from Roles and from IIS.

Now, I can't install it back using installer (because its part of OS so it is asking me to enable it from role & features). And I can't start server manager (to install role & features) because it needs .Net 4 at minimum.

1.Server Manager Error 2. .NET4 Setup Error

So I am stuck. Do I have any other option than reinstalling OS ? I have sent so much time testing this system, I would rather not do it if possible.

UPDATE: I already tried .NET installer for older Windows OS but it didn't help.

JackLock

Posted 2017-02-28T16:07:50.880

Reputation: 600

Try this offline installer (.NET 4.6): https://www.microsoft.com/en-US/download/details.aspx?id=48137

– duDE – 2017-02-28T16:10:52.010

Tried it already. Unfortunately it ends with message that this is not for your OS. Apparently it's not for 2016. – JackLock – 2017-02-28T16:13:16.320

Maybe can this helps: http://www.technig.com/how-to-install-windows-features-offline-using-dism/

– duDE – 2017-02-28T16:17:02.703

1@dude , downloading iso from MSDN and then going to try. Though not have very high hopes because DISM document doesn't mention support for Server 2016. I will post my finding here. – JackLock – 2017-02-28T16:26:57.793

1@dude, It worked !! I "enabled" 4.6 and everything is back on track. I can't believe that. This has literally saved me 2 days of re-setup time. I really appreciate your help. If you put your suggestion in answers and I will accept it as answer (and add comment about command that helped) so future visitors can be benefited. – JackLock – 2017-02-28T16:59:19.400

Answers

13

Try to to install .NET Offline using DISM like in this example for .NET 3.5:

Type the following command: “Dism /online /enable-feature /featurename:Netfx3 /source:D:\Sources\sxs” and then press enter. It take a while and when the process has finished, close the PowerShell Windows then go to check the exact windows features must be installed successfully.

Thank you @JackLock for this comment:

So based on your suggestion, I enabled feature called "NetFx4". Since it was already installed, I didn't need to provide source of it. So my command looked like

Dism /online /Enable-Feature /FeatureName:NetFx4 /All

duDE

Posted 2017-02-28T16:07:50.880

Reputation: 14 097

2So based on your suggestion, I enabled feature called "NetFx4". Since it was already installed, I didn't need to provide source of it. So my command looked like Dism /online /Enable-Feature /FeatureName:NetFx4 /All – JackLock – 2017-02-28T17:16:09.953

0

Thank you duDE and JackLock. Both of your answers helped me to fix this problem.

My problem: On Windows Server 2016, the .NET Framework 4.6 had been inadvertently uninstalled from my system while trying to fix some issues with IIS. It was removed using the Server Manager > Remove Roles and Features.

As a result, the Power Shell, Server Manager, and Event Viewer were no longer working. So I downloaded and installed the latest offline version of the .NET Framework 4.7 from Microsoft using the installer. However, it did not fix the problem when installed by clicking on the installer.

Solution To fix the problem, I had to install it from the command line using the "/all" switch. I unzipped the installer to a folder and here is the command that I used to install it. In the last argument in quotes is the path to the installer, which will need to be modified based on where you have the installer unzipped:

Dism /online /enable-feature /all /featurename:Netfx4 /source:"E:\t\NDP47-KB3186497-x86-x64-AllOS-ENU (Microsoft .NET Framework 4.7)"

Michael Russ

Posted 2017-02-28T16:07:50.880

Reputation: 17

It’s not possible for .NET Framework 4.6 to be uninstalled from Windows Server 2016 (it’s built-in). The command you issued installed .NET Framework 4.7 which replaced .NET Framework 4.6 – Ramhound – 2019-10-21T18:01:50.243

1.NET Framework 4.6 can be uninstalled from Windows Server 2016, but it does cause a number of built-in applications to also not work (such as ServerManager). – Slogmeister Extraordinaire – 2019-10-22T17:23:59.130