Installing .Net 3.5 on Windows 2012 R2

Solution 1:

The command I use to install .NET Framework 3.5 on Windows 8.1 and Server 2012 R2 is:

DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:D:\sources\sxs

Where D:\ is the mounted ISO or DVD drive. The only difference from yours is the /LimitAccess, but I believe that is the important part, as it prevents it from attempting to contact Windows Update or WSUS. For whatever reason, this aspect (contacting Windows Update) is totally broken for .NET Framework 3.5 on Windows 8/8.1 and Server 2012/2012R2 and will always cause it to fail.

See also: http://blogs.technet.com/b/askcore/archive/2012/05/14/windows-8-and-net-framework-3-5.aspx

Solution 2:

I had the same issue when I mount the Windows install disk or use the physical DVD, and here's how I fixed it:

  1. Create a folder under root (C:\NetFx3 for example)
  2. Copy the microsoft-windows-netfx3-ondemand-package.cab from a Windows install disk .\sources\sxs to the C:\NetFx3 folder
  3. Command Prompt as an administrator
  4. DISM.exe /online /enable-feature /featurename:NetFX3 /All /Source:C:\NetFX3 /LimitAccess
  5. The text progress bar will go to 100% when completed and will give you a message: "The operation completed successfully".

For whatever reason, my optical drive shows the files on the disk, but the DISM doesn't like it, but copying the files to C: seems to have worked.


Solution 3:

The solution for me was a combination of these answers. I was on a machine with Windows Server 2012 R2.

I tried working around the fact that I did not have an ISO of the OS on-hand. But could not get it to work. So I was forced to find an ISO for Windows Server 2012 R2.

1.) Start the Local Group Policy Editor or Group Policy Management Console (WIN+R and type gpedit.msc).

2.) Expand Computer Configuration, expand Administrative Templates, and then select System.

3.) Open the "Specify settings for optional component installation and component repair Group Policy" setting, and then select Enabled.

4.) Select the "Contact Windows Update directly to download repair content instead of Windows Server Update Services (WSUS)" checkbox. Click Apply, Click Ok.

wsus settings

5.) Download an ISO of the OS and mount the image. I downloaded one here: https://www.technig.com/download-windows-server-2012-r2-essentials-iso-file/

*Note: it's a 3Gb file.

6.) Open an elevated Powershell and run:

DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:E:\sources\sxs

*Note: the ISO was mounted to the "E:\ drive" in this case.

install Net 3.5 with Powershell

*This thread was a life-saver. Thanks to all contributors, especially @Joshua McKinnon!