I had trouble installing .Net framework 3.5 on a Windows 2012 R2 server. .Net framework 3.5 is a prerequisite for SQL Server 2012 R2.
.Net Framework 3.5 and 4.5.1 can be installed from Server Manager but I am unable to install it. The solution is to install via command line make sure you have the Windows 2012 Server DVD in the DVD drive.
Open command prompt as run as administrator
Then execute the following command:
Dism /online /enable-feature /featurename:NetFx3 /All /Source:D:\sources\sxs /LimitAccess
Thanks to the Microsoft link: