I ran into a weird issue on a freshly installed fully patched Windows Server 2012 R2. I tried to enable the the .NET Framework 3.5 feature but kept getting failures that the source files could not be found from the GUI and from command line. To fix the issue I had to uninstall a bunch of .NET framework related KB’s, see below for the full list. I found KB3002547 that looked promising but that did not fix my issue. Scroll down to “Troubleshoot the issue” section to see how to fix this.

Errors
Error code | Error messages |
---|---|
0x800F0906 |
The source files could not be downloaded.
Use the “source” option to specify the location of the files that are required to restore the feature. For more information about specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077. The DISM log file can be found at C:\Windows\Logs\DISM\dism.log Windows couldn’t complete the requested changes. Windows couldn’t connect to the Internet to download necessary files. Make sure that you’re connected to the Internet, and click “Retry” to try again. Installation of one or more roles, role services, or features failed. |
0x800F081F |
The source files could not be found.
Use the “Source” option to specify the location of the files that are required to restore the feature. For more information about specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077. The DISM log file can be found at C:\Windows\Logs\DISM\dism.log 0x800F081F – CBS_E_SOURCE_MISSING Error code: 0x800F081F Error: 0x800F081F |
TROUBLESHOOT THE ISSUE
Attempt to install the .NET framwork so it generates a fresh CBS file and open it up in notepad. Look for an error “Failed to find package”, it will list a KB number right behind this. You will have to remove this KB as it was installed when .NET framework was not present and it appears to be causing an issue. In my case i had to remove about 20 of these KBs as a new one showed up every time and then it allowed me to install .NET framework 3.5.
.NET Framwork installation LOG file
C:\Windows\Logs\CBS\CBS

To check if a KB is installed
run the below command (Case sensitive make sure KB is uppercase)
wmic qfe | findstr KB4457045

To Uninstall a KB
To remove a windows update open up PowerShell and run:
WUSA /UNINSTALL /KB:4040981

The Fix
To fix the issue and be able to install .NET 3.5, I had to uninstall the following KBs one by one. Open up powershell and run each command below. This is as of May 2019, if you try this in a few months or years there could be more KB’s to uninstall, check the CSB log file mentioned above.
Uninstall these KBs and install .NET framework 3.5, once its installed then you can safely re-install them again and it won’t cause an issue as .NET is already installed properly.
WUSA /UNINSTALL /KB:2968296
WUSA /UNINSTALL /KB:2972103
WUSA /UNINSTALL /KB:2972213
WUSA /UNINSTALL /KB:3023219
WUSA /UNINSTALL /KB:3037576
WUSA /UNINSTALL /KB:3074545
WUSA /UNINSTALL /KB:3097992
WUSA /UNINSTALL /KB:3127222
WUSA /UNINSTALL /KB:4014574
WUSA /UNINSTALL /KB:4014581
WUSA /UNINSTALL /KB:4040981
WUSA /UNINSTALL /KB:4054177
WUSA /UNINSTALL /KB:4095515
WUSA /UNINSTALL /KB:4095875
WUSA /UNINSTALL /KB:4457045
WUSA /UNINSTALL /KB:2966828