I just wanted to post what I learned from trying to install the .NET Framework 3.5.1 on Windows Server 2012 R2. Apparently, Windows Server 2012 and Windows 8 use a concept called Features on Demand, where the source files for Windows features are not installed on the machine by default. Thus, you either have to use Windows Update, or provide a WIM image file or a side-by-side (SxS) store.
Following most help on the web, I tried to use the Add Roles and Features Wizard and specify a source file location pointing to a copy of the sources/sxs folder in the installation media. I still continued to get errors, even when using DISM and following various troubleshooting procedures. It appears that having a Windows Server Update Service (WSUS) configured was causing the problem. Once I made the connection, I was able to find the following articles. The second article helps explain the concepts very well.
By configuring the group policy setting Specify settings for optional component installation and component repair, I was able to install the .NET Framework 3.5.1 through the Add Roles and Features Wizard using both Windows Update or my sources/sxs folder from the installation media.
So, if your system administrator uses WSUS to manage the updates installed on your server, try reading the links above if you can't get .NET Framework 3.5.1 or other Windows features installed.