简体   繁体   中英

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM