In an adminstrative command prompt, type:
%SystemDrive%
cd %SystemRoot%\Microsoft.NET\Framework\v2.0.50727\CONFIG
copy machine.config.default machine.config
copy web.config.default web.config
copy web_hightrust.config.default web_hightrust.config
copy web_lowtrust.config.default web_lowtrust.config
copy web_mediumtrust.config.default web_mediumtrust.config
copy web_minimaltrust.config.default web_minimaltrust.config
(If you're feeling lazy, run the batch file instead.)
Open the Windows Features control panel applet and try turning on .NET Framework 3.5.1 again.
After perusing "CBS.log" in "%SystemRoot%\Logs\CBS", I discovered that the built-in installer of .NET Framework 3.5.1 expects to find these files properly configured. If it can't, it rolls back the entire installation and prompts you to restart (?!). Luckily, .NET 2.0.50727 comes packed with .default files that are templates for real configuration files. The batch file above just makes copies of these files.
I'm not sure exactly what brought about this conundrum. It may have been the .NET Framework Cleanup Tool, or some other such "helpful" utility. Either way, it's solved now and I can continue to customise the Windows 7 logon screen using the dirty .NET-based tool presumably built by a twelve-year-old that I found.
You are my hero! Your post saved my life and I won't need to format!
ReplyDeleteTLDR
ReplyDeleteSays access is denied on an administrator user account.
ReplyDeleteDoes the caption of your command prompt start with "Administrator:"?
ReplyDeleteTry running the steps through Windows explorer instead. Open the CONFIG folder (in all but the most exotic of configurations, this will be "C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG"), make copies of the .default files listed above and remove their .default extension.
Sorry to hear the command line method didn't work for you. Hope this helps.
If it's a 64-bit system you need to use
ReplyDelete%SystemRoot%\Microsoft.NET\Framework64\v2.0.50727\CONFIG
... the directory listed above exists, along with all the expected files, but it probably won't fix your problem.
This worked and has made my night! Thanks!
ReplyDeleteran the batch file as admin - same error
ReplyDeletemanually enter the commands line by line in cmd-admin mode - same error
manually renamed and backup the config files in Framework64 - same error
manually renamed and backup the config files in Framework - same error
i have window7 64bit and i have removed all other dotnet versions using cleanup tool and restarted.
i dont understand what to do what he is telling us tell me my email........sobanali790@gmail.com
Deletei dont understand what to do what he is telling us tell me my email........sobanali790@gmail.com
DeleteThanks for the solution! As with the other successful posters, it worked for me, and saved me a TON of time, avoiding having to reimage my machine.
ReplyDeletethank you!!!!!!!!!!!!!!!!!!!!!!!!! :D
ReplyDeleteThis comment has been removed by the author.
ReplyDeletecan you re-upload the .bat archive please... i'm not too good with commands and i have no lucky doing executing these comands please help me :(
DeleteThanks so much....... 2 weeks of nightmare just ended!
ReplyDeleteDid nothing. :(
ReplyDeleteThis comment has been removed by the author.
ReplyDeletePlease Help. I typed Everything you told me to in the command promt. Now i cant even see the .Net Framwork 3.5 options in the turn windows feature on and off menu. Please Help
ReplyDeleteSame happened to me. I believe you have to restart... :-) But in my case... this solution did not help to reinstall framework 3.5 :-(((
DeleteAlso did not work for me with Windows 7 SP1 64-Bit. Tried above solution from Framework64 folder, which also did not work.
ReplyDeleteAlso did not work for me with Windows 7 SP1 64-Bit. Tried above solution from Framework64 folder, which also did not work.
ReplyDeleteDid it both ways usind command prompt and bat file, still same error. I have 32Bit W7 professional. Some help maybe?
ReplyDeleteDidn't work.
ReplyDeleteWhat DID work for me was a third party .net 3.5 OFFLINE installer.