如何在 Windows 10 中安装 .NET 4 Framework
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/35733040/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to install .NET 4 Framework in Windows 10
提问by Ho Pam
How can I install the .NET 4.0 Framework in Windows 10? .NET 4.6 is already installed but I want to have .NET 4 Framework (without modifying the registry).
如何在 Windows 10 中安装 .NET 4.0 Framework?.NET 4.6 已经安装,但我想要 .NET 4 Framework(不修改注册表)。
Turning on and off Windows features in control panel does not have any effect.
在控制面板中打开和关闭 Windows 功能没有任何效果。
采纳答案by Wai Ha Lee
From the download pagefor the "Microsoft .NET Framework 4.6" (emphasis mine):
从“Microsoft .NET Framework 4.6”的下载页面(重点是我的):
The Microsoft .NET Framework 4.6 is a highly compatible, in-place updateto the Microsoft .NET Framework 4, Microsoft .NET Framework 4.5, Microsoft .NET Framework 4.5.1 and Microsoft .NET Framework 4.5.2.
Microsoft .NET Framework 4.6 是对 Microsoft .NET Framework 4、Microsoft .NET Framework 4.5、Microsoft .NET Framework 4.5.1 和 Microsoft .NET Framework 4.5.2的高度兼容的就地更新。
On other words, having .NET 4.6 installed (it's part of Windows 10so you need not manually install it) means you have.NET 4.0, 4.5, 4.5.1, 4.5.2 and 4.6 installed and can run code targeting any of those framework versions without making any modifications to your Windows installation.
换言之,安装 .NET 4.6(它是 Windows 10的一部分,因此您无需手动安装)意味着您安装了.NET 4.0、4.5、4.5.1、4.5.2 和 4.6,并且可以运行针对其中任何一个的代码框架版本,而无需对您的 Windows 安装进行任何修改。
You cannotinstall .NET 4.0 when you have a later version installed as each version is an in-place update to the last.
如果安装了更高版本,则无法安装 .NET 4.0,因为每个版本都是上一个版本的就地更新。
If, however, your problem is with opening a project which targets .NET 4.0.1, 4.0.2, or 4.0.3 in Visual Studio on Windows 10, you mayneed to download one of the targeting packs:
但是,如果您的问题是在 Windows 10 上的 Visual Studio 中打开面向 .NET 4.0.1、4.0.2 或 4.0.3 的项目,则可能需要下载以下目标包之一:
- Multi-Targeting Pack for .NET 4.0.1
- Multi-Targeting Pack for .NET 4.0.2
- Multi-Targeting Pack for .NET 4.0.3
as I'm not sure theyare installed.
因为我不确定它们是否已安装。
回答by foxx1337
If you reallywant to install the development part of .NET 4.0 or 4.5.2 in Windows 10 you need, depending on the version, the following:
如果你真的想在 Windows 10 中安装 .NET 4.0 或 4.5.2 的开发部分,你需要根据版本,以下内容:
The libraries:
for 4.5.2, grab the .NET framework 4.5.2 Developer Pack
for 4.0, grab the Microsoft Windows SDK for Windows 7 and .NET Framework 4 (ISO), mount it and run
Setup\SDKSetup.exe(the autorun will cry that .NET 4 isn't available in Windows 10 so go directly toSDKSetup.exe). Note that you'll need to grabGRMSDKX_~, which is probably the x64 version out of the 3 available there, {x86, itanium, x64}, otherwise it cries about not finding some file.Anyways, install from there only 1 package -
.NET Development\Intellisense and Reference Assembliesand move further.- upgrade 4.0 to the latest 4.0.3 with the Multi-Targeting Pack for Microsoft .NET Framework 4.0.3 (KB2600213)
The tools (
csc,msbuild): grab the 2017 versions, the newest, as they'll work with both 4.5.2 or 4.0 from before. Go to the Visual Studio downloads site, scroll down and download from way below the Build Tools for Visual Studio 2017package.From the setup you'll need the following Individual components:
- .NET Framework 4.6.1 SDK
- .NET Framework 4.6.1 targetting pack (they're useful because they bring nice executables such as
tlbimp.exefor example) - C# and Visual Basic Roslyn compilers (brings
csc.exeandmsbuild.exe)
图书馆:
对于 4.5.2,获取.NET framework 4.5.2 Developer Pack
对于 4.0,获取适用于 Windows 7 和 .NET Framework 4 (ISO)的Microsoft Windows SDK,安装它并运行
Setup\SDKSetup.exe(自动运行会抱怨 .NET 4 在 Windows 10 中不可用,所以直接转到SDKSetup.exe)。请注意,您需要获取GRMSDKX_~,这可能是那里可用的 3 个中的 x64 版本,{x86, itanium, x64},否则它会抱怨找不到某些文件。无论如何,从那里只安装 1 个包 -
.NET Development\Intellisense and Reference Assemblies并进一步移动。- 使用Microsoft .NET Framework 4.0.3的多目标包将 4.0 升级到最新的4.0.3 (KB2600213)
工具 (
csc,msbuild):获取最新的 2017 版本,因为它们可以与之前的 4.5.2 或 4.0 一起使用。转到Visual Studio 下载站点,向下滚动并从Build Tools for Visual Studio 2017包下方的方式下载。从设置中,您将需要以下独立组件:
- .NET 框架 4.6.1 SDK
- .NET Framework 4.6.1 目标包(它们很有用,因为它们带来了不错的可执行文件
tlbimp.exe,例如) - C# 和 Visual Basic Roslyn 编译器(带有
csc.exe和msbuild.exe)
You should be golden now!
你现在应该是金色的!
回答by Dealazer
If you manage to use a tool to remove Net Framework 4+ from Windows 10 ISO for a fresh install.
如果您设法使用工具从 Windows 10 ISO 中删除 Net Framework 4+ 以进行全新安装。
Then you can then install a fresh install of Net Framework 4.5, not 4.0. Since Windows 10 would not allow that for 4.0.
然后,您可以安装全新安装的 Net Framework 4.5,而不是 4.0。由于 Windows 10 不允许 4.0.
I'm really unsure if there are some removal tools for 4.6 and 4.7. Since I've tried the direct way to work with installation of 7 SDK. But then only 4.5 is able to be installed.
我真的不确定 4.6 和 4.7 是否有一些删除工具。因为我已经尝试过安装 7 SDK 的直接方法。但是只有4.5才能安装。
Then it's possible to install Windows 7 SDK fully, when you install 4.5.
然后可以在安装 4.5 时完全安装 Windows 7 SDK。
If Windows 7 SDK cries for 2.0 or 3.5 install it in the apps and features.
如果 Windows 7 SDK 要求 2.0 或 3.5,请将其安装在应用程序和功能中。
You can use a tool called NTlite and edit the .wim file installation of Windows 10. Then use compatibles to remove 4+. Then save and start up the copied ISO in C:, and start an installation in Windows 10. That way you also can keep settings and apps that you already installed, just removing main source files of Windows 10. Also keeping your Windows Activated.
您可以使用名为 NTlite 的工具并编辑 Windows 10 的 .wim 文件安装。然后使用 compatibles 删除 4+。然后在 C: 中保存并启动复制的 ISO,并在 Windows 10 中开始安装。这样您还可以保留已安装的设置和应用程序,只需删除 Windows 10 的主要源文件。同时保持您的 Windows 激活。
回答by Uday
You can not install older version. As you're already running on .Net framework 4.6, it is not possible to downgrade it. However, Windows 10 already comes with .NET framework by default, why do you need to install the older version?
您无法安装旧版本。由于您已经在 .Net framework 4.6 上运行,因此无法将其降级。不过,Windows 10 已经默认自带.NET框架了,为什么还要安装老版本呢?
According to this website, you can either choose web installer or offline installer for installing .NET framework. You can try downloading the .NET framework 4 from here.
根据此网站,您可以选择 Web 安装程序或离线安装程序来安装 .NET 框架。您可以尝试从这里下载 .NET framework 4 。

