How to install .NET Framework 3.5 on Windows Server 2012 and Windows Server 2012 R2

I ran across this issue again (figured it was due to the media not being available) and decided to document the resolution.

When trying to add the .NET Framework 3.5 feature through the Add Roles and Features Wizard in Server 2012 (R2), you receive the following error:

Do you need to specify an alternate source path?  One or more installation selections are missing source files on the destination server.  The server will try to get missing source files from Windows Update, or from a location that is specified by Group Policy.  You can also click the “Specify an alternate source path” link on this page to provide a valid location for the source files.

 

Complete the steps below to manually install .NET Framework 3.5 from the Server 2012 (R2) installation media.

Command Line fix:

  1. Insert the Windows Sever 2012 installation media (or mount it if you are using virtualization).
  2. Open an elevated command prompt.
  3. Execute the following command: dism /Online /Enable-Feature /FeatureName:NetFX3 /All /Source:D:\Sources\SxS\ /LimitAccess

That fixes the issue, you can also specify an alternate source from the GUI, but where is the fun in that?