How can I install .Net 3.5 on Windows 10? - c#

I need to install .Net 3.5 so I can use SQL Server Express/Local Db in Visual Studio.
I have trawled the internet looking for answers and nothing works.
It got stuck on this all night, this is enabling .Net 3.5 from the Control Panel.
I even redownloaded Windows 10 and run this DISM command
DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:c:\sources\sxs
but it still hangs and won't do anything.
If anyone could help me out that would be super helpful

.NET 3.5 cant be install by internet. you have to use your installation DVD or ISO downloaded from Microsoft website.
use this command to install
DISM /Online /Enable-Feature /FeatureName:NetFx3 /Source:d:\sources\sxs /All /LimitAccess
d: should be the
ISO mapped drive if you use ISO file
DVD drive if you use installation DVD
Few important points.
If you use ISO file, There can be errors if you try to use a ISO from a network location.
If you download ISO from Microsoft web site careful about 32 bit and 64 bit.
Run command prompt as Administrator to run this command
If your command prompt hang without any response, probably it means Some windows updates installation is in progress. So restart the computer and try again.
Go to "Turn Windows feature on or off" window.If you installed properly, you can see .NET framework 3.5 is installed.
Here is the step by step guide I have written. http://codeketchup.blogspot.sg/2015/11/how-to-install-net-framework-35-on.html

If you have access to MSDN subscription, download the Windows 10 Features on Demand ISO, mount it and run this command:
DISM.EXE /Online /Add-Capability /CapabilityName:NetFx3~~~~ /Source:D:\
(where D: is the mounted ISO)
If this fails, run this command to add the files back to your Windows
DISM.EXE /Online /Add-Package /PackagePath:D:\Microsoft-Windows-NetFx3-OnDemand-Package.cab
and now go to the UI to enable the feature.

If you don't have your Windows installation media at hand or want it easier:
These are the methods without the commandline DISM command, which work interactively- for the first two you need current internet access:
Normally it is enough to start an application requiring .NET 3.5 and Windows will bring up a dialog for installation over internet.
Type "windows feature" in the magnifier (search) line besides the start button and switch to
Turn Windows features on or off
Control panel
Then you find the known dialog from previous versions to turn .NET 3.5 features on, etc. (At least I was unable to find it from new settings dialog without search.)
If you updated Windows 10, and you had .NET 3.5 activated before on Win 7 or 8.x, then you have to do nothing, it is also activated in Windows 10.
Here is the real offline "emergency" installer:
http://www.smart-arab.com/2013/12/install-net-on-windows-8-1-and-windows-10-offline/
Of course this is not the official way.

You need to go to add remove programs and then add features to windows, then select it from here. This will install .net 3.5 and 2.0
edit 1
Please open a command prompt (cmd.exe) as admin and run the following command to install .Net 3.5:
DISM /Online /Enable-Feature /FeatureName:NetFx3 /Source:d:\sources\sxs /All /LimitAccess
(replace D: with your mounted Win10 ISO)
In some environment, DISM fails to fetch the file (Proxy, network policies). The DISM command takes the files from the DVD and you're fine

1. Open CMD as an administrate
Command: Dism /online /enable-feature /featurename:NetFX3 /All /Source:D:\sources\sxs /LimitAccess
here D=partition name Mout
Open ISO file of windows 10 and type D where Partition.
Finally Open Windows Features and then you will see Net Framework 3.5 has been install and enable.

Related

Unable to install .NET Framework 3.5 through SCCM on Windows 10

I recently had to uninstall/re-install .NET Framework 3.5 on my new Windows 10 work machine to troubleshoot another issue. I have to install it via SCCM due to Group Policy blocking Windows Updates (so I can't just install via Control Panel > Turn Features On/Off).
When attempting to re-install through SCCM the install just spins in the Installing state indefinitely until it times out.
Steps taken:
Uninstalled the .NET 3.5 Framework via Turn Windows Features On and Off in Control Panel and restarted machine.
Went to SCCM and attempted to install software, and it hung indefinitely.
After 2 hours I restarted machine to check if I just wasn't alerted it was finished for some reason
Install did not finish, Failed status shows with the error code for timeout in SCCM.
Other Info:
I verified no errors were generated in the SCCM log files or Event Viewer.
I can't install via Control Panel MS Update download as mentioned above due to Group Policy, I can't do an Offline install b/c these laptops don't have a disk drive (for whatever reason that was decided to be ok), and I can't do a system restore to before I removed it due to drive encryption software.
No admin accounts or similar can get different results, and I've verified it is not the SCCM install itself after getting it to install on another machine just fine.
I've ran both the .NET Framework Repair tools and Clean-up tools and I still get the issue.
Any ideas on what I can try?
If anyone encounters a situation similar, I was able to fix it by extracting the microsoft-windows-netfx3-ondemand-package.cab file from the .iso of Windows 10.
Using that file you can run the following script in an elevated (administrator) powershell and it will install the files offline for you.
Dism /online /enable-feature /featurename:NetFX3 /All /Source:<path to file>

Uninstalling Windows Hotfix via C# or PowerShell

In our Company we need to uninstall a Windows Hotfix thats installed on the System. I've done a PowerShell Script that checks if the specified Update (Lookup via KBArticleID) is installed or not and then reports this via Textfile to the Server.
There is a Windows built-in Tool called WUSA (Windows-Update-Standalone-Installer) that allows to uninstall Updates with a specified KB-Article-ID. The Problem is that under Windows 7, 8.1 and 10 the WUSA-Tools only works in normal interactive Mode and not in the quiet Mode that we need. I'm running like this:
wusa.exe /uninstall /kb:3114409 /norestart /quiet
As described the Problem is that this command will only run in Interactive Mode and not Quiet.
Do you have any solutions or hints? I would prefer to implement this via PowerSehll or C# but other Solutions are welcome too :)
Thanks for your help!
Old post, but the heck..
I tried this on a windows 2012 R2 server and it worked:
Start-Process wusa.exe -ArgumentList '/KB:3170455 /uninstall /quiet /norestart' -Wait

.Net framework mscorpe.dll error

I have a client machine with Windows 7 Professional installed on it. In order to run my latest application, I installed .Net Framework version 4.0 Full, download from here. My application works fine.
However, there is another application developed in .Net framework 3.5. When I try to execute that application, I get an error:
C:\Windows\Microsoft.Net\Framework64\v2.0.50727\mscorepe.dll is either
not designed to run on Windows or it contains an error ...
I have tried removing .Net framework 4.0 and reinstalling it again and I tried repairing it, but nothing seems to work. The error remains.
I have tried installing .Net framework 3.5 separately, but I can't install it since a newer version (4.0) is already installed on the machine.
The application with version 3.5 works fine on other client machines, so I guess the issue is isolated to .Net framework installation on that particular machine.
Is there any way to repair mscorpe.dll or re-install .Net framework 3.5 ?
First, verify that the file is corrupt and that it cannot be repaired automatically.
Run:
sfc /scanfile=C:\Windows\Microsoft.Net\Framework64\v2.0.50727\mscorepe.dll
If you see the message:
Windows Resource Protection found corrupt files but was unable to fix some of them.
It means that both the file and the backup file that Windows uses to perform the repair are damaged.
Windows cannot automatically repair the file and this particular file is not replaced when you reinstall the .Net 3.5 framework.
To restore the file manually:
Install 7-Zip (the 32-bit x86 version).
Open an administrative command prompt.
Insert a copy of Windows 7 Professional into the DVD drive or mount the ISO image.
Run the following commands from the administrative command prompt.
Take ownership of the file:
takeown /f C:\Windows\Microsoft.Net\Framework64\v2.0.50727\mscorpe.dll
Grant the necessary permissions to overwrite the file:
icacls C:\Windows\Microsoft.Net\Framework64\v2.0.50727\mscorpe.dll /GRANT ADMINISTRATORS:F
Replace the file with the original from the installation DVD. Note, that this assumes that the DVD is available on the D: drive. Change the drive letter, if necessary, to suit your setup.
"C:\Program Files (x86)\7-Zip\7z.exe" e D:\sources\install.wim -oC:\Windows\Microsoft.Net\Framework64\v2.0.50727\ 4\windows\Microsoft.Net\Framework64\v2.0.50727\mscorpe.dll
Enter Y when prompted to overwrite the file.
Ensure that the .Net 3.5 Windows feature is enabled and retest your application.
Note: If you don't have access to the Windows installation DVD or ISO you can run the first two commands and then copy mscorpe.dll from another machine running Windows 7 Professional x64. Make sure that you copy it from the C:\Windows\Microsoft.Net\Framework64\v2.0.50727\ folder.
Chris O'Neill's answer helped me in resolving my issue, I modified it a bit and here is what I did.
Copied a working mscorpe.dll to local computer from another machine
Open Command prompt in administrator mode
Execute the following command on command prompt
Commnad:
takeown /f C:\Windows\Microsoft.Net\Framework64\v2.0.50727\mscorpe.dll
(adjust your paths accordingly)
It returned a message like:
SUCCESS: The file (or folder):
"C:\Windows\Microsoft.Net\Framework64\v2.0.50727\mscorpe.dll" now
owned by user "loggedInUser".
After that executed the following command to grant privileges.
Command:
icacls C:\Windows\Microsoft.Net\Framework64\v2.0.50727\mscorpe.dll /GRANT ADMINISTRATORS:F
Got the following response.
processed file:
C:\Windows\Microsoft.Net\Framework64\v2.0.50727\mscorpe.dll
Successfully processed 1 files; Failed processing 0 files
Then I copied the correct file copied from another machine to that location:
xcopy c:\K2PublisherError\mscorpe.dll C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorpe.dll /y
This fixed the error.

How can I repair .NET Framework 4.0 on Windows 8?

While trying debug my real problem, I'm trying to repair the .NET framework, because it looks like something in System.Data.SqlClient is hosed. But you can't uninstall this because it's part of the OS in Windows8, and you can't install it because it's already installed, and so I can't find any way to fix my problem. I suppose I could reinstall the whole OS, but that's way too painful.
To Repair corrupted Windows files in Windows 8, open a command prompt with admin rights and run this DISM command:
DISM /Online /Cleanup-Image /RestoreHealth
This downloads the clean files and installs them correctly.

How to "Install"/"Enable" .Net 3.5 SP1 under Windows 7?

I'm writing a deployment application that should install all required components before load main module. But I has an issue with dotnet 3.5 SP1 installation on Windows 7. Windows 7 incorporate the dotnet 3.5 SP1, but some times that component disabled by user/manufacturer/...
User can enable it from the Control Panel, but I can't ask him to do that.
How can I enable it from my software, I should exclude a all manual configuration from the deployment process.
I found a way by myself, through ocsetup.exe.
The final command is:
%systemroot%\system32\ocsetup.exe NetFx3
Update:
ocsetup is not available at Winodws 8+, you should use dism to achive the same result.
For Winodws 8+ you have to use the following command:
DISM /Online /Enable-Feature /FeatureName:NetFx3 /All
Being a Win7 user that has had unending problems with .NET 3.5 and would prefer it just stay disabled because it's corrupt, doesn't work right anyway, and once in this state is unfixable in Win7 without a whole new, fresh install of Windows, I wish programmers would just NOT require it be installed. .NET 4.1+ are 3.5.1 backwards compatible and if you write your code properly so that you are looking for 3.5 functionality rather than 3.5 itself, it works and if you coded it right in the first place, you could just install 4.2 instead of 3.5 and it would work, but I have a small handful of programs, including all of MS's own email applications (like outlook) that just insist on using .NET 3.5 and you know what? None of them work on my system.
I would also like to add that if I did install some piece of software that turned on or off windows features on my system without asking for permission first, you'd be getting hate mail from me and that software would be off my system as quickly as I could uninstall it and delete it's folders.

Categories

Resources