Thursday 12 November 2015

** Fixed ** Error: 0x800f081f 0x800f0907. The source files could not be found. Installing .Net Framework v3.5 on Windows Server 2012

Scroll down to the update for the fix, continue reading below for some background.

Today I thought I would write about the process of installing .Net Framework v3.5 on Windows Server 2012 when the server does not have an internet connection. This process caused me a lot of problems and I wasted a lot of time on it today. It seems many others are experiencing the same problem.

Windows Server 2012 requires that .Net Framework is enabled via as a feature rather than using the installation file method that we are used to in previous versions of Windows. For servers with an internet connection this works fine, and can be achieved in a number of ways (eg. Add roles and features wizard, PowerShell). My problems began when I started working on a server without internet access.

The official guide from Microsoft is here, and it all sounds simple enough. Doing this with the wizard displayed a warning before I started.


Selecting the Install option (as expected) caused the installation to fail:
"Installation of one or more roles, role services, or features failed.
The source files could not be found. Try installing the roles, role services, or features again in a new Add Roles and Features Wizard session, and on the Confirmation page of the wizard, click "Specify an alternate source path" to specify a valid location of the source files that are required for the installation. The location must be accessible by the computer account of the destination server"



I followed the advice in the error, and copied the .\sources\sxs folder from the installation DVD to a local folder, then selected that folder within the "Specify an alternate source path" option of the wizard.
This did not make any difference and the installation failed with the same error.

A few google searches led me to this article, which references KB3005628 as a fix for this problem. However, this fix corrects the problem when it was caused by the installation of security update 2966827 or 2966828.

Get-Hotfix | where { ($_.HotfixID -eq "KB296682" -or $_.HotfixID -eq "KB2966828") }

This PowerShell command will reveal whether or not these updates have been installed. In my case the server was not patched and so this was not the cause of the problem.

Various further google searches revealed many other users have similar issues, and I tried several other methods of installing .Net Framework v3.5, and all of them failed. Here are a few examples:

Dism /online /enable-feature /featurename:NetFX3 /all /Source:d:\sources\sxs



Dism /Online /Enable-Feature /FeatureName:NetFx3 /Source:X:\Sources\WinSXS /all /limitaccess



Install-WindowsFeature –Name NET-Framework-Features –Source D:\Sources\sxs



I also tried to enable the policy Specify settings for optional component installation and component repair.
This is located in Computer Configuration\Administrative Templates\System

I enabled the policy and enabled "Never attempt to download payload from Windows Update". This made no difference, and the installation still fails no matter how I attempt to install it.

 

** Update **

01 Feb 2016


Today I finally resolved this problem, below are the steps I had to take to get it working, hopefully this method can save someone some time. Note that this fix requires a Windows Server 2012 r2 machine on which the .Net 3.5 installation has been successful

First, follow the steps in this Microsoft support page. If these steps don't help, as was the case for me, try using my method.

Step 1
On a server where the installation fails, get a list of all folders in the WinSXS folder.

I used the following PowerShell command
Get-ChildItem -Path C:\Windows\WinSxS | select name | out-file D:\WinSXSfiles.txt

Then I copied WinSXSfiles.txt to a server where a previous installation had been successful.

Step2
Copy the list of folders to a (Windows 2012 r2) server where the installation has been successful. Compare this list to the contents of the WinSXS folder (on the successful server), and get a copy of all the folders that are missing on the server where the install fails.

I used the following PowerShell script:

#Get the folder contents of local WinSXS, select only the name, pass to foreach command
Get-ChildItem C:\Windows\WinSxS | select -ExpandProperty name | foreach {

#Foreach folder name, check whether it exists in the list of folders from the problem machine
if ( !(select-string -Path D:\WinSXSfiles.txt -Pattern $_) ) {

#Write any missing folder names to the console
Write-Host $_ -ForegroundColor Yellow

#Copy missing folders to a temporary folder D:\WinSXS
Copy-Item "C:\Windows\WinSxS\$_" -Destination D:\WinSXS\ -Recurse
}
}

 
Step 3
Copy the missing folders to the server where the installation fails

Step 4
Use Dism, with the Source option pointing at both WinSXS folders.

Dism /Online /Enable-Feature /FeatureName:NetFx3 /Source:C:\Windows\WinSXS /Source:D:\WinSXS /all /limitaccess

In my example I use 2 WinSXS folders. I didn't want to copy nearly 700 potentially unnecessary folders into the WinSXS folder on the C: drive. To get around this I created a temporary WinSXS folder (D:\WinSXS) and gave the DISM command a second /Source folder.

I found this page useful for explaining the DISM switches.

I had nearly 700 extra folders in WinSXS on my machine where the installation was successful. Looking through these I found a large number with names that started amd64_netfx

I expect that with some trial and error I could work out the exact folders that were necessary for the installation to be successful - probably some/all of those with names starting amd64_netfx.
However, to save time, my method of creating a temporary WinSXS folder works fine.

 

 




27 comments:

  1. Just wanted to say that this is great and fixed something that has been driving me insane for ages!!!!

    ReplyDelete
  2. This post is very awesome, really I am glade see this post. You are provide relative information by this post. Thanks
    How to Configure Work Folders Windows 2012

    ReplyDelete
  3. Simply awesome post. In my case it was KB2966828.

    ReplyDelete
  4. Bleeding AWESOME. Love your work, the script and dism worked for me.

    ReplyDelete
  5. Hi There,
    Thanks alot for this, it just worked, one small correction in your last command
    Dism /Online /Enable-Feature /FeatureName:NetFx3 /Source:C:\Windows\WinSXS /Source:D:\WinSXS /all /limitaccess

    Instead of C:\windows\winsxs we had to specify the installation files of windows E:\windows\winsxs and it worked

    ReplyDelete
  6. You are the MAN!!!!!! Important that you have both the WinSXS copy from the working server and a Server 2012 r2 ISO. Without both, you cannot complete the install. Took me 4 hours to finally come across this solution.

    ReplyDelete
  7. Write more; that’s all I have to say. It seems as though you relied on the video to make your point. You know what you’re talking about, why waste your intelligence on just posting videos to your blog when you could be giving us something enlightening to read?
    Check out the best python training in chennai at SLA

    ReplyDelete
  8. Can't thank you enough for this information. Spent hours looking for a solution and none of them worked. Keep up the good work!!

    ReplyDelete

  9. Excellent! I love to post a comment that "The content of your post is awesome" Great work!

    top data analytics courses in mumbai

    ReplyDelete
  10. Excellent blog with lots of information, keep sharing. I am waiting for your more posts like this or related to any other informative topic.Amazing web journal I visit this blog it's extremely marvelous. Interestingly, in this blog content composed plainly and reasonable. The substance of data is educationalData Science Training In Chennai

    Data Science Online Training In Chennai

    Data Science Training In Bangalore

    Data Science Training In Hyderabad

    Data Science Training In Coimbatore

    Data Science Training

    Data Science Online Training

    ReplyDelete
  11. Thank you for the informative post. It was thoroughly helpful to me. Keep posting more such articles and enlighten us.

    AI Training in Hyderabad

    ReplyDelete
  12. I have recently started a blog, the info you provide on this site has helped me greatly. Thanks for all of your time & work ExcelR Data Analytics Course

    ReplyDelete
  13. This is a fabulous post I seen because of offer it. It is really what I expected to see trust in future you will continue in sharing such a mind boggling post
    data scientist training and placement

    ReplyDelete
  14. this blog was really great, never seen a great blog like this before. i think im gonna share this to my friends..
    data science course in hyderabad

    ReplyDelete
  15. Really awesome blog. Informative content and useful to my people. Thanks for sharing this blog with us.
    Data Science Course with Placements in Hyderabad

    ReplyDelete
  16. You completed certain reliable points there. I did a search on the subject and found nearly all people will agree with your blog.
    data scientist course in hyderabad

    ReplyDelete
  17. I’m happy I located this blog! From time to time, students want to recognize the keys of productive literary essays. Your first-class knowledge about this good post can become a proper basis for such people. nice one
    data analytics courses in hyderabad with placements

    ReplyDelete
  18. I’ve read some good stuff here. Definitely worth bookmarking for revisiting. I surprise how much effort you put to create such a great informative website. data scientist course in mysore

    ReplyDelete
  19. This post is an absolute lifesaver! Installing .Net Framework v3.5 on Windows Server 2012 without an internet connection can be a real headache, but your detailed solution is a game-changer. Thanks for sharing this valuable information and saving us from endless troubleshooting frustration!
    Data Analytics Courses in Nashik

    ReplyDelete
  20. I appreciate how the author addresses potential issues and provides solutions to common installation problems.
    Data Analytics Courses In Chennai

    ReplyDelete
  21. good blog
    Data Analytics Courses In Vadodara

    ReplyDelete
  22. Installing .NET Framework v3.5 on Windows Server 2012 is a crucial step for running legacy applications and ensuring compatibility in the server environment. In the realm of data analytics, Glasgow offers comprehensive Data Analytics courses to equip professionals with the skills needed for harnessing data's potential. Please also read Data Analytics courses in Glasgow.

    ReplyDelete
  23. Thanks for sharing outstanding tutorial on installing Net Framework v3.5 on Windows Server 2012.
    data analyst courses in limerick

    ReplyDelete
  24. Good piece of information. Please keep us updating with your regular feeds.
    Investment banking courses after 12th

    ReplyDelete