Install .NET Framework 4 (or 4.6) in Windows Server 2016
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
Related videos on Youtube
JackLock
Just like everyone I am here to learn 'n share knowledge.
Updated on September 18, 2022Comments
-
JackLock over 1 year
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.
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.
-
Leo Chapiro over 7 yearsTry this offline installer (.NET 4.6): microsoft.com/en-US/download/details.aspx?id=48137
-
JackLock over 7 yearsTried it already. Unfortunately it ends with message that this is not for your OS. Apparently it's not for 2016.
-
Leo Chapiro over 7 yearsMaybe can this helps: technig.com/how-to-install-windows-features-offline-using-dism
-
JackLock over 7 years@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 over 7 years@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 over 7 yearsSo 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
-
Ramhound over 4 yearsIt’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
-
Slogmeister Extraordinaire over 4 years.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).