安装面向开发人员的 .NET FrameworkInstall the .NET Framework for developers

.NET 是在 Windows 上运行的多个应用不可缺少的一部分,并且对这些应用运行发挥着同样的功能。.NET is an integral part of many apps running on Windows and provides common functionality for those apps to run. 对开发人员而言,.NET Framework 为生成具有视觉冲击力的用户体验和无缝安全通信的应用提供了一个全面且一致的编程模型。For developers, the .NET Framework provides a comprehensive and consistent programming model for building apps that have visually stunning user experiences and seamless and secure communication.

备注

本主题面向希望在自己的系统上安装 .NET Framework 或与其应用程序一起安装 .NET Framework 的开发者。This topic is intended for developers who either want to install the .NET Framework on their own system or who want to install it with their applications. 如果用户对安装 .NET Framework 感兴趣,请参阅单独介绍如何在特定操作系统上安装 .NET Framework 的主题,例如在 Windows 10 和 Windows Server 2016 上安装 .NET FrameworkFor users interested in installing the .NET Framework, see the individual topics that discuss installing the .NET Framework on specific operating systems, such as Install the .NET Framework on Windows 10 and Windows Server 2016.

本文提供了在计算机上安装所有版本的 .NET Framework(从 .NET Framework 4.5 到 .NET Framework 4.7.2.NET Framework 4.7.2)的链接。This article provides links for installing all versions of the .NET Framework from the .NET Framework 4.5 to the .NET Framework 4.7.2.NET Framework 4.7.2 on your computer. 如果你是开发人员,你也可以使用这些链接来下载 .NET Framework 并将其与你的应用程序一起重新分发。If you're a developer, you can also use these links to download and redistribute the .NET Framework with your apps. 有关使用你的应用部署 .NET Framework 版本的信息,请参阅针对开发人员的 .NET Framework 部署指南For information on deploying a version of the .NET Framework with your app, see .NET Framework deployment guide for developers.

重要

从 .NET Framework 4 开始,所有 .NET Framework 版本都是就地更新的,因此,在系统中只能存在一个 4.x 版本。All .NET Framework versions since .NET Framework 4 are in-place updates, so only a single 4.x version can be present on a system. 此外,某些版本的 Windows 操作系统上预装了特定版本的 .NET Framework。In addition, particular versions of the .NET Framework are pre-installed on some versions of the Windows operating system. 这表示:This means that:

  • 如果在计算机上已安装了更高的 4.x 版本,则无法安装以前的 4.x 版本。If there's a later 4.x version installed on the machine already, you can't install a previous 4.x version.
  • 如果操作系统预安装了特定的 .NET Framework 版本,则无法在同一计算机上安装以前的 4.x 版本。If the OS comes pre-installed with a particular .NET Framework version, you can't install a previous 4.x version on the same machine.
  • 如果你安装更高版本,则无需先卸载以前的版本。If you install a later version, you don't have to first uninstall the previous version.

有关 .NET Framework 版本及如何确定计算机上安装版本的详细信息,请参阅版本和依赖项如何:确定已安装的 .NET Framework 版本For more information about versions of the .NET Framework and how to determine which versions are installed on a computer, see Versions and Dependencies and How to: Determine Which .NET Framework Versions Are Installed.

备注

有关 .NET Framework 3.5 的信息,请参阅在 Windows 10、Windows 8.1 和 Windows 8 上安装 .NET Framework 3.5For information on the .NET Framework 3.5, see Install the .NET Framework 3.5 on Windows 10, Windows 8.1, and Windows 8.

使用下表获取快速链接或进一步阅读以获取详细信息。Use the following table for quick links, or read further for details. 若要在安装前查看 .NET Framework 的系统要求,请参阅系统要求To view the system requirements for the .NET Framework before installation, see System Requirements. 有关疑难解答的帮助,请参阅疑难解答For help with troubleshooting, see Troubleshooting.

.NET Framework 版本.NET Framework version 开发人员安装Developer installation 可再发行组件安装Redistributable installation 平台支持Platform support
4.7.24.7.2 .NET Framework 4.7.2 开发人员工具包.NET Framework 4.7.2 Developer Pack 下载中心 4.7.2 Web 安装程序Download Center 4.7.2 web installer

下载中心 4.7.2 脱机安装程序Download Center 4.7.2 offline installer
包含于:Included in:

Windows 10 2018 年 10 月更新Windows 10 October 2018 Update
Windows 10 2018 年 4 月更新Windows 10 April 2018 Update
Windows Server 2019Windows Server 2019
Windows Server 版本 1809Windows Server, Version 1809
Windows Server 版本 1803Windows Server, Version 1803

可以安装于:You can install on:

Windows 10 Fall Creators UpdateWindows 10 Fall Creators Update
Windows 10 创意者更新Windows 10 Creators Update
Windows 10 周年更新Windows 10 Anniversary Update
Windows 8.1 和更早版本Windows 8.1 and earlier
Windows Server 1709 和更低版本Windows Server, version 1709 and earlier

(有关完整列表,请参阅系统要求(for a full list, see system requirements)
4.7.14.7.1 .NET Framework 4.7.1 开发人员工具包NET Framework 4.7.1 Developer Pack 4.7.1 Web 安装程序下载页Download page for 4.7.1 web installer

4.7.1 脱机安装程序下载页Download page for 4.7.1 offline installer
包含于:Included in:

Windows 10 Fall Creators UpdateWindows 10 Fall Creators Update
Windows Server 版本 1709Windows Server, version 1709

可以安装于:You can install on:

Windows 10 创意者更新Windows 10 Creators Update
Windows 10 周年更新Windows 10 Anniversary Update
Windows 8.1 和更早版本Windows 8.1 and earlier
Windows Server 2016 和更低版本Windows Server 2016 and earlier
(有关完整列表,请参阅系统要求(for a full list, see system requirements)
4.74.7 .NET Framework 4.7 开发人员工具包NET Framework 4.7 Developer Pack 4.7 Web 安装程序下载页Download page for 4.7 web installer

4.7 脱机安装程序下载页Download page for 4.7 offline installer
包含于:Included in:

Windows 10 创意者更新Windows 10 Creators Update

可以安装于:You can install on:

Windows 10 周年更新Windows 10 Anniversary Update
Windows 8.1 和更早版本Windows 8.1 and earlier
Windows Server 2016 和更低版本Windows Server 2016 and earlier
(有关完整列表,请参阅系统要求(for a full list, see system requirements)
4.6.24.6.2 .NET Framework 4.6.2 开发人员工具包NET Framework 4.6.2 Developer Pack 4.6.2 Web 安装程序下载页Download page for 4.6.2 web installer

4.6.2 脱机安装程序下载页Download page for 4.6.2 offline installer
包含于:Included in:

Windows 10 周年更新Windows 10 Anniversary Update

可以安装于:You can install on:

Windows 10 November UpdateWindows 10 November Update
Windows 10Windows 10
Windows 8.1 和更早版本Windows 8.1 and earlier
Windows Server 2012 R2 和更早版本Windows Server 2012 R2 and earlier
(有关完整列表,请参阅系统要求(for a full list, see system requirements)
4.6.14.6.1 .NET Framework 4.6.1 开发人员工具包NET Framework 4.6.1 Developer Pack 4.6.1 Web 安装程序下载页Download page for 4.6.1 web installer

4.6.1 脱机安装程序下载页Download page for 4.6.1 offline installer
可以安装于:You can install on:

Windows 10Windows 10
Windows 8.1 和更早版本Windows 8.1 and earlier
Windows Server 2012 R2 和更早版本Windows Server 2012 R2 and earlier
(有关完整列表,请参阅系统要求(for a full list, see system requirements)
4.64.6 包含在 Visual Studio 2015 中。Included in Visual Studio 2015.

Microsoft .NET Framework 4.6 目标包Microsoft .NET Framework 4.6 targeting pack
4.6 Web 安装程序下载页Download page for 4.6 web installer

4.6 脱机安装程序下载页Download page for 4.6 offline installer
包含于:Included in:

Windows 10Windows 10
Visual Studio 2015Visual Studio 2015

还可以安装于:You can also install on:

Windows 8.1 和更早版本Windows 8.1 and earlier
Windows Server 2012 R2 和更早版本Windows Server 2012 R2 and earlier
(有关完整列表,请参阅系统要求(for a full list, see system requirements)
4.5.24.5.2 Microsoft .NET Framework 4.5.2 开发人员工具包Microsoft .NET Framework 4.5.2 Developer Pack

适用于 Visual Studio 2013、Visual Studio 2012 或其他 IDEFor use with Visual Studio 2013, Visual Studio 2012, or other IDEs
4.5.2 Web 安装程序下载页Download page for 4.5.2 web installer

4.5.2 脱机安装程序下载页Download page for 4.5.2 offline installer
可以安装于:You can install on:

Windows 8.1 和更早版本Windows 8.1 and earlier
Windows Server 2012 R2 和更早版本Windows Server 2012 R2 and earlier
(有关完整列表,请参阅系统要求(for a full list, see system requirements)
4.5.14.5.1 Microsoft .NET Framework 4.5.1 开发人员工具包Microsoft .NET Framework 4.5.1 Developer Pack

适用于 Visual Studio 2013、Visual Studio 2012 或其他 IDEFor use with Visual Studio 2013, Visual Studio 2012 or other IDEs
4.5.1 Web 安装程序下载页Download page for 4.5.1 web installer

4.5.1 脱机安装程序下载页Download page for 4.5.1 offline installer
包含于:Included in:

Windows 8.1Windows 8.1
Windows Server 2012 R2Windows Server 2012 R2
Visual Studio 2013Visual Studio 2013

还可以安装于:You can also install on:

Windows 8Windows 8 和更早版本and earlier
Windows Server 2012Windows Server 2012 和更早版本and earlier
(有关完整列表,请参阅系统要求(for a full list, see system requirements)
4.54.5 包含于 Visual Studio 2012 中Included in Visual Studio 2012

也可作为 Windows 8 SDK 的一部分提供Also available as part of the Windows 8 SDK
4.5 Web 安装程序下载页Download page for 4.5 web installer 包含于:Included in:

Windows 8Windows 8
Windows Server 2012Windows Server 2012
Visual Studio 2012Visual Studio 2012

还可以安装于:You can also install on:

Windows 7 和更早版本Windows 7 and earlier
Windows Server 2008 SP2 和更早版本Windows Server 2008 SP2 and earlier
(有关完整列表,请参阅系统要求(for a full list, see system requirements)

可以在所有支持的平台上针对特定版本的 .NET Framework(如果有)安装开发人员工具包。You can install the Developer Pack for a specific version of the .NET Framework, if one is available, on all supported platforms.

可以在以下系统上安装 Web 或脱机安装程序You can install the Web or Offline installer on:

  • Windows 8.1 和更早版本Windows 8.1 and earlier

  • Windows Server 2012 R2 和更早版本Windows Server 2012 R2 and earlier

有关完整列表,请参阅系统要求For a full list, see System Requirements.

有关适用于用户和开发人员的 .NET Framework 的常规说明,请参阅入门For a general introduction to the .NET Framework for both users and developers, see Getting Started. 有关使用应用部署 .NET Framework 的信息,请参阅部署指南For information about deploying the .NET Framework with your app, see the deployment guide. 若要了解 .NET Framework 的体系结构和主要功能,请参阅概述To read about the architecture and key features of the .NET Framework, see the overview.

安装选项Installation choices

安装开发人员目标包以在 Visual Studio 或其他开发环境中针对最新版本的 .NET Framework 进行开发,或下载 .NET Framework 可再发行组件以与你的应用或控件一起分发。Install a developer targeting pack to develop against the most recent version of the .NET Framework in Visual Studio or another development environment, or download the .NET Framework redistributable for distribution with your app or control.

安装 .NET Framework 开发人员工具包或目标包To install the .NET Framework Developer Pack or Targeting Pack

在 Visual Studio 和其他开发环境中进行开发时,目标包让应用面向特定版本的 .NET Framework。A targeting pack lets your app target a specific version of the .NET Framework when developing in Visual Studio and some other development environments. 开发人员工具包包括特定版本的 .NET Framework 及其附带的 SDK 和对应的目标包。A developer pack includes a specific version of the .NET Framework and its accompanying SDK along with its corresponding targeting pack.

.NET Framework 4.5.1 或 4.5.2 开发人员工具包、.NET Framework 4.6 目标包以及 .NET Framework 4.6.1、4.6.2、4.7、4.7.1 或 4.7.2 开发人员工具包提供特定 .NET Framework 版本的引用程序集、语言包和 IntelliSense 文件,以供在集成开发环境(如 Visual Studio)中使用。The developer pack for the .NET Framework 4.5.1 or 4.5.2, the targeting pack for the .NET Framework 4.6, and the developer pack for the .NET Framework 4.6.1, 4.6.2, 4.7, 4.7.1, or 4.7.2 provides a particular .NET Framework's version of the reference assemblies, language packs, and IntelliSense files for use in an integrated development environment such as Visual Studio. 如果你使用的是 Visual Studio,则在你创建新项目时,开发人员包或目标包也将向目标选择添加 .NET Framework 的已安装版本。If you are using Visual Studio, the developer pack or targeting pack also adds the installed version of the .NET Framework to the target choices when you create a new project. 选择以下选项之一:Choose one of the following:

从开发人员工具包下载页中,选择“下载”。From the developer pack download page, choose Download. 随后选择“运行”或“保存”,并在出现提示时按照说明操作。Next choose Run or Save, and follow the instructions when prompted. 通过在 Visual Studio 安装程序的 .NET 桌面开发工作负载的可选组件中进行选择,还可以安装适用于特定版本的 .NET Framework 的开发人员工具包或目标包。You can also install the developer pack or targeting pack for a specific version of the .NET Framework by selecting it from the optional components in the .NET desktop development workload in the Visual Studio Installer, as the following figure shows.

包含 .NET 桌面开发工作负载的 Visual Studio 安装程序

如果面向特定版本的 .NET Framework,使用该版本的开发人员工具包中随附的引用程序集生成应用程序。When you target a particular version of the .NET Framework, your application is built by using the reference assemblies that are included with that version's developer pack. 在运行时,从全局程序集缓存解析程序集,并且不使用引用程序集。At runtime, assemblies are resolved from the Global Assembly Cache, and the reference assemblies are not used.

使用 Visual Studio 或使用 MSBuild 通过命令行生成应用程序时,MSBuild 可能会显示错误 MSB3644:未找到“framework-version”框架的引用程序集。When building an application from Visual Studio or using MSBuild from the command line, MSBuild may display error MSB3644, "The reference assemblies for framework "framework-version" were not found." 要解决此错误,请下载适用于该版本 .NET Framework 的开发人员工具包或目标包。To address the error, download the developer pack or the targeting pack for that version of the .NET Framework.

安装或下载 .NET Framework 可再发行组件To install or download the .NET Framework redistributable

安装程序为面向这些版本的 .NET Framework 的应用或控件下载 .NET Framework 组件。Installers download the .NET Framework components for an app or control that targets those versions of the .NET Framework. 这些组件必须安装在运行应用程序或控件的每台计算机上。These components must be installed on each computer where the app or control runs. 这些安装程序是可再发行的,因此你可将其包含在你的应用的安装程序中。These installers are redistributable, so you can include them in the setup program for your app.

下载页以多种语言提供,但大多数下载仅以英语提供。The download page is provided in several languages, but most of the downloads are provided in English only. 若要获得其他语言支持,你必须安装语言包。For additional language support, you must install a language pack.

提供了两种类型的可再发行组件安装程序:Two types of redistributable installers are available:

  • Web 安装程序(Web 引导程序)用于从 Web 下载匹配安装计算机的操作系统的所需组件和语言包。Web installer (web bootstrapper) downloads the required components and the language pack that matches the operating system of the installation computer from the web. 此程序包远远小于脱机安装程序,但需要一致的 Internet 连接。This package is much smaller than the offline installer but requires a consistent Internet connection. 可以下载独立的语言包来安装其他语言支持。You can download the standalone language packs to install additional language support.

  • 脱机安装程序(独立的可再发行组件)包含安装 .NET Framework 所需的所有组件,但不包含语言包。Offline installer (standalone redistributable) contains all the required components for installing the .NET Framework but doesn't contain language packs. 此下载大于 Web 安装程序。This download is larger than the web installer. 脱机安装程序不需要 Internet 连接。The offline installer doesn't require an Internet connection. 运行脱机安装程序后,可以下载独立的语言包来安装语言支持。After you run the offline installer, you can download the standalone language packs to install language support. 如果你无法拥有一致的 Internet 连接,请使用脱机安装程序。Use the offline installer if you can't rely on having a consistent Internet connection.

Web 和脱机安装程序均针对基于 x86 和 x64 的计算机而设计(请参阅系统要求),但不支持基于 Itanium 的计算机。Both web and offline installers are designed for x86-based and x64-based computers (see system requirements), but do not support Itanium-based computers.

  1. 打开要安装的 .NET Framework 版本的下载页:Open the download page for the .NET Framework version you want to install:

  2. 选择下载页的语言。Select the language for the download page. 此选项不会下载 .NET Framework 的本地化资源;它只影响下载页上显示的文本。This option does not download the localized resources of the .NET Framework; it only affects the text displayed on the download page.

  3. 选择“下载”。Choose Download.

  4. 出现提示时,请选择与系统体系结构相匹配的下载,然后选择“下一步”。If prompted, select the download that matches your system architecture, and then choose Next.

  5. 显示下载提示时,执行下列操作之一:When the download prompt appears do ONE of the following:

    • 如果要在计算机上安装 .NET Framework,请选择“运行”,然后按照屏幕上的提示操作。If you want to install the .NET Framework on your computer, choose Run, and then follow the prompts on your screen.

    • 如果要下载 .NET Framework 以供重新分发,请选择“保存”,然后按照屏幕上的提示操作。If you want to download the .NET Framework for redistribution, choose Save, and then follow the prompts on your screen.

  6. 若要下载其他语言的资源,请按照下一节中的说明进行操作来安装一个或多个语言包。If you want to download resources for additional languages, follow the instructions in the next section to install one or more language packs.

备注

如果在安装期间遇到任何问题,请参阅疑难解答If you encounter any problems during the installation, see Troubleshooting.

安装说明:Installation notes:

  • .NET Framework 4.5.1 和 4.5.2 以及 .NET Framework 4.6、4.6.1、4.6.2、4.7、4.7.1 和 4.7.2 是对 .NET Framework 4.5 的就地更新。The .NET Framework 4.5.1 and 4.5.2, as well as the .NET Framework 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, and 4.7.2 are in-place updates to the .NET Framework 4.5.

  • .NET Framework 4.5 及其单点版本、.NET Framework 4.6 及其单点版本和 .NET Framework 4.7 及其单点版本将替换 .NET Framework 4。The .NET Framework 4.5, its point releases, the .NET Framework 4.6 and its point releases, and the .NET Framework 4.7 and its point releases replace the .NET Framework 4. 在安装了 .NET Framework 4 的系统上安装这些版本时,将会替换这些程序集。When you install these versions on a system that has the .NET Framework 4 installed, the assemblies are replaced.

  • 卸载 .NET Framework 4.5 及其单点版本、.NET Framework 4.6 及其单点版本或 .NET Framework 4.7 及其单点版本也会删除既有的 .NET Framework 4 文件。Uninstalling the .NET Framework 4.5, its point releases, the .NET Framework 4.6 and its point releases, or the .NET Framework 4.7 and its point releases also removes pre-existing .NET Framework 4 files. 若要返回到 .NET Framework 4,你必须重新安装它以及它的任何更新。If you want to go back to the .NET Framework 4, you must reinstall it and any updates to it. (请参阅 安装 .NET Framework 4。)(See Installing the .NET Framework 4.)

  • 必须拥有管理员凭据,才能安装 .NET Framework 4.5 及其单点版本、.NET Framework 4.6 及其单点版本和 .NET Framework 4.7 及其单点版本。You must have administrative credentials to install the .NET Framework 4.5, its point releases, the .NET Framework 4.6 and its point releases, and the .NET Framework 4.7 and its point release.

  • .NET Framework 4.5 可再发行组件于 2012 年 10 月 9 日进行了更新,纠正了一个与数字证书中的错误时间戳相关的问题,此问题会导致 Microsoft 生成并签名的文件中的数字签名提前过期。The .NET Framework 4.5 redistributable was updated on October 9, 2012 to correct an issue related to an improper timestamp on a digital certificate, which caused the digital signature on files produced and signed by Microsoft to expire prematurely. 如果之前安装了日期为 2012 年 8 月 16 日的 .NET Framework 4.5 可再发行组件包,建议使用 Microsoft 下载中心内的最新可再发行组件来更新副本。If you previously installed the .NET Framework 4.5 redistributable package dated August 16, 2012, we recommend that you update your copy with the latest redistributable from the Microsoft Download Center. 有关此问题的详细信息,请参阅 Microsoft 安全公告 2749655知识库文章 2770445For more information about this issue, see Microsoft Security Advisory 2749655 and Knowledge Base article 2770445.

安装语言包To install language packs

语言包是包含受支持语言的本地化资源(例如,翻译后的错误消息和 UI 文本)的可执行文件。Language packs are executable files that contain the localized resources (such as translated error messages and UI text) for supported languages. 如果你不安装语言包,则会用英语显示 .NET Framework 错误消息和其他文本。If you don't install a language pack, .NET Framework error messages and other text are displayed in English. 请注意,Web 安装程序会自动安装与你的操作系统相匹配的语言包,但是你可以将其他语言包下载到你的计算机。Note that the web installer automatically installs the language pack that matches your operating system, but you can download additional language packs to your computer. 脱机安装程序不包含任何语言包。The offline installers don’t include any language packs.

重要

语言包不包含运行应用程序所需的 .NET Framework 组件,因此,你必须在安装语言包之前运行 Web 安装程序或脱机安装程序。The language packs don't contain the .NET Framework components that are required to run an app, so you must run the web or offline installer before you install a language pack. 如果已安装语言包,请将其卸载,安装 .NET Framework,然后重新安装语言包。If you have already installed a language pack, uninstall it, install the .NET Framework, and then reinstall the language pack.

  1. 打开已安装的 .NET Framework 版本的语言包下载页:Open the language pack download page for the .NET Framework version you've installed:

  2. 在语言列表中,选择要下载的语言,并等待几秒钟,以便使用该语言重新加载页面。In the language list, choose the language you want to download, and wait a few seconds for the page to reload in that language.

  3. 选择“下载”。Choose Download.

下表列出了支持的语言。The following table lists the supported languages.

语言Language cultureCulture
阿拉伯语Arabic arar
捷克语Czech cscs
丹麦语Danish dada
荷兰语Dutch nlnl
芬兰语Finnish fifi
英语(美国)English (USA) en-USen-US
法语French frfr
德语German dede
希腊语Greek elel
希伯来语Hebrew hehe
匈牙利语Hungarian huhu
意大利语Italian itit
日语Japanese jaja
朝鲜语Korean koko
挪威语Norwegian no
波兰语Polish plpl
葡萄牙语(巴西)Portuguese (Brazil) pt-BRpt-BR
葡萄牙语(葡萄牙)Portuguese (Portugal) pt-PTpt-PT
俄语Russian ruru
简体中文Simplified Chinese zh-CHSzh-CHS
西班牙语Spanish eses
瑞典语Swedish svsv
繁体中文Traditional Chinese zh-CHTzh-CHT
土耳其语Turkish trtr

后续步骤Next steps

请参阅See also