简体   繁体   English

在Windows 7下如何“安装” /“启用” .Net 3.5 SP1?

[英]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. 但是我在Windows 7上安装dotnet 3.5 SP1时遇到问题。Windows7包含dotnet 3.5 SP1,但有时该组件已被用户/制造商/ ...禁用。用户可以从“控制面板”中启用它,但我不能请他这样做。 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. 我自己通过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. ocsetup在Winodws 8+上不可用,您应该使用dism获得相同的结果。 For Winodws 8+ you have to use the following command: 对于Winodws 8+,您必须使用以下命令:

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. 作为一个Win7用户,它在.NET 3.5上遇到了无休止的问题,并且希望它保持禁用状态,因为它已损坏,无论如何都无法正常工作,而且一旦处于这种状态就无法在Win7中修复,而无需全新安装全新的Windows,我希望程序员不要要求安装它。 .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? .NET 4.1+是向后兼容3.5.1的,如果您正确编写代码以寻找3.5功能而不是3.5本身,则它可以工作,并且如果您首先对其进行编码,则可以安装4.2而不是3.5可以使用,但是我只有一小部分程序,包括MS自己的所有电子邮件应用程序(例如Outlook),它们都坚持使用.NET 3.5,您知道吗? 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. 我还要补充一点,如果我确实在未事先征得许可的情况下在系统上安装了一些可以打开或关闭Windows功能的软件,则您会收到来自我的仇恨邮件,并且该软件将尽快从我的系统中退出。因为我可以卸载它并删除它的文件夹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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