Most modern Windows applications require .NET Framework to work properly. The roles and features setup wizard Server Manager in Windows Server 2012 R2 allows to install two different versions of .NET Framework at a time – 3.5 and 4.5. The installation of .NET Framework 4.5 doesn’t usually cause any problems – it’s very simple, however, you can’t say exactly the same about the installation of .NET Framework 3.5.
Actually, when trying to install .NET Framework 3.5 in Windows Server 2012 R2 with the standard settings, the following error message appears: “Installation of one of more roles, role services or features failed. The source files could not be found…”.
The reason behind this behavior is that .NET Framework 3.5 binary files are not a part of the local cache of the binary files that are saved on the server’s system disk when the operating system is being installed. This is done under the concept of Features on Demand in Windows Server 2012 to reduce the amount of disk space occupied by the OS for its own needs.
Check if .NET Framework 3.5 is in the local repository using the Powershell command:
Get-WindowsFeature *Framework* |
As you can see, the required component is deleted (Install State: Removed).
By default, when you install NET Framework 3.5 through Server Manager, the system tries to obtain the necessary files from the Windows Update website over the Internet (not from the local WSUS server), and if the server does not have Internet access, the installation fails. The user needs to specify the path to the OS distribution from which the missing component could be installed.
To install .NET Framework 3.5 manually, click Specify an alternative source path to enter an alternative path to a folder containing the installation disk of Windows Server 2012 R2.
As the path, you can specify either a local folder (in our example it is D:\source\sxs, where D:\ is a letter of the local DVD drive with a Windows Server distribution), or a network folder.
By clicking OK, the system will find .NET Framework 3.5 binaries and install the component.
The same operation can be performed from the command prompt by running the following command as an administrator:
dism /online /enable-feature /featurename:NetFX3 /all /Source:d:\sources\sxs /LimitAccess |
/Online means that you need to upgrade your current OS, and not the wim image
/enable-feature/featurename: NetFX3/all means that it is necessary to install .NET Framework 3.5 with all its features
/Source is the path to the directory with Windows distribution, which contains the necessary components
/LimitAccess prevents accessing Windows Update
The same operation in PowerShell for installing .Net 3.5 looks like this:
Add-WindowsFeature NET-Framework-Core -Source d:\sources\sxs |
Path to the original Windows distribution can be set in the system on a regular basis using:
- the registry parameter RepairContentServerSource that is located in the HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Servicing branch
- or a group policy Specify settings for optional component installation and component repair (the policy changes this setting in the registry)
To verify that the .NET Framework 3.5 is installed, go to the C:\Windows\Microsoft.NET\Framework64 directory and make sure that v3.5 folder appeared.
If the .NET Framework 3.5.1 installation methods described above did not help you, try the following solutions.
After installing some updates, the version (build) of Windows Server 2012 R2 in the system may cease to correspond to the image of the OS stored in your distribution image. In this case, the installer, when comparing the version of the Windows kernel, refuses to install the deprecated version of the component. In this case, as a rule, when you install the .NET Framework through dism, the following error occurs: 0x800f081f. The source files could not be found
To fix the problem try to install .Net online through from Microsoft servers:
- Save the current Windows Update settings to the reg file (key HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate)
- Delete this key and restart the WU service:
net stop wuauserv & net start wuauserv
- Run the .Net5 online installation:
DISM /Online /Enable-Feature /FeatureName:NetFx3 /All
- After the installation is complete, return the WU settings by importing the reg file and restart the WindowsUpdate service again
dism /online /enable-feature /featurename:NetFX3 /all /Source:C:\tmp\winsxs /LimitAccess
In addition, if you installed a Language Packs on the server, before you install the .NET Framework 3.5.1, you must uninstall it using the lpksetup command.
Also check that there are installed patches for NET 3.5 Framework in the list of installed system updates (in theory they should not have been installed if the NetFX3 component is not installed).
Uninstall this updates and after the reboot, try installing .NET 3.5.
19 comments
If you encounter problems installing .NET 3.5 (source could not be found error), install this update:
https://support.microsoft.com/kb/3005628
Thank you.
It was very useful article.
thank you , it helped me
the request to add or remove features on the specified server failed installation on one or more roles, role services or features failed. error:0x800f0907
I was troubleshoot all the given process getting same issue
Pls give me the solution asap
Thx for very useful article!
Thanks….Really it help me
Thanks….it helpfull
The issue exists even after doing that.
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
C:\Windows\system32>dism /online /enable-feature /featurename:NetFX3 /all /Sourc
e:C:\Windows\WinSxS /LimitAccess
Deployment Image Servicing and Management tool
Version: 6.3.9600.17031
Image Version: 6.3.9600.17031
Enabling feature(s)
[===========================66.2%====== ]
Error: 0x800f081f
The source files could not be found.
Use the “Source” option to specify the location of the files that are required t
o restore the feature. For more information on 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
C:\Windows\system32>dism /online /enable-feature /featurename:NetFX3 /all /Sourc
e:C:\Windows\WinSxS /LimitAccess
You are use wrong Source parameter. Instead pointed on files in C:\Windows\WinSxS, you must specify path to winsx folder on USB/ ISO / mounted iso file with Windows 2012 distribution.
For example:
Dism.exe /online /enable-feature /featurename:NetFX3 /All /Source:E:\sources\SxS /LimitAccess
thank you so much. it solved my problem
Thank you for this. Solved my problem. Cheers!
Hi,
I would like to know, can we use any powershell or DISM commands to enable ‘Specify settings for optional component installation and component repair’ under Group policy editor in order to install NetFx3 from online.
Kindly assist me, I am looking for automate this process.
if you have a problem with install .NET 3.5:
follow these comands with powershell:
Get-WindowsFeature *Framework*
Install-WindowsFeature Net-Framework-Core -source d:\sources\sxs
In one of your screenshots above you note D:/Source but it should be D:/Sources
I upgraded 5 servers to 2012r2 from 2008r2….production….
Could not get 3.5 to install.
Found a reference server that had same windows version but was in a different domain, and had 3.5 installed.
The windows update/group policy changes did not work for me.
so ran:
net use z: \\%IP%\c$ /user:%domain%\%username%
dism /online /enable-feature /featurename:netfx3 /all /LimitAccess /source:z:\windows\winsxs
Hello, I wrote a Powershell script for the above registry method Which seems to work best for me. see below:
https://github.com/ctejeda/PowerShell-Modules/blob/master/Force-Install.NET-Framework
Damn dude I wanna hug you for this, worked as a charm thanks
Very helpful. The DSIM CMD helped me on a box with no internet access. I pointed it to another 2012 R2 box that already had it and it worked like a charm.