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

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.

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

How can I install .Net 3.5 on Windows 10?

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.

How to create a install/uninstall/repair .exe in windows application?

I am new to windows application.Created a tool in windows application and with the help of setup build a exe and install it.
If i try to install when it is already installed its showing another version is already install so i have to go to control pannel uninstall it then install it again .
How can i do it in that way
When not install - Install it
When installed - Uninstall it then install the new version.
When you made a working software, next step is called distributing. Which mostly means putting all your software files into a distribute package. For this you have to choose distribute system (my favorite is NSIS).
It is the job of installer to detect whenever software is already installed and offer Repair or Uninstall option. And it should be very basic thing supported by distribute system (read - it will be very easy to do).

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