安装 Visual StudioInstall Visual Studio

欢迎使用 Visual Studio 2019!Welcome to Visual Studio 2019! 在此版本中,可轻松选择并仅安装所需功能。In this version, it's easy to choose and install just the features you need. 并且由于其最小占用减小,因此其安装速度快且对系统的影响极小。And because of its reduced minimum footprint, it installs quickly and with less system impact.

欢迎以全新方式安装 Visual Studio!Welcome to a new way to install Visual Studio! 在此版本中,可更轻松地选择并仅安装所需功能。In this version, we've made it easier for you to choose and install just the features you need. 此外,我们还减少了 Visual Studio 的最小内存需求量,使其安装速度变得更快,对系统的影响更小。We've also reduced the minimum footprint of Visual Studio so that it installs more quickly and with less system impact than ever before.

Note

本主题适用于 Visual Studio Windows 版。This topic applies to Visual Studio on Windows. 对于 Visual Studio for Mac,请参阅安装 Visual Studio for MacFor Visual Studio for Mac, see Install Visual Studio for Mac.

想要详细了解此版本的其他新增功能?Want to know more about what else is new in this version? 请参阅我们的发行说明See our release notes.

想要详细了解此版本的其他新增功能?Want to know more about what else is new in this version? 请参阅我们的发行说明See our release notes.

准备安装?Ready to install? 我们将逐步引导你完成安装。We'll walk you through it, step-by-step.

第 1 步 - 确保计算机支持 Visual StudioStep 1 - Make sure your computer is ready for Visual Studio

开始安装 Visual Studio 前:Before you begin installing Visual Studio:

  1. 查看系统要求Check the system requirements. 这些要求有助于了解计算机是否支持 Visual Studio 2017。These requirements help you know whether your computer supports Visual Studio 2017.

  2. 应用最新的 Windows 更新。Apply the latest Windows updates. 这些更新可确保计算机包含最新的安全更新程序和 Visual Studio 所需的系统组件。These updates ensure that your computer has both the latest security updates and the required system components for Visual Studio.

  3. 重新启动。Reboot. 重新启动可确保挂起的任何安装或更新都不会影响 Visual Studio 安装。The reboot ensures that any pending installs or updates don't hinder the Visual Studio install.

  4. 释放空间。Free up space. 通过运行磁盘清理应用程序等方式,从 %SystemDrive% 删除不需要的文件和应用程序。Remove unneeded files and applications from your %SystemDrive% by, for example, running the Disk Cleanup app.

  1. 查看系统要求Check the system requirements. 这些要求有助于了解计算机是否支持 Visual Studio 2019。These requirements help you know whether your computer supports Visual Studio 2019.

  2. 应用最新的 Windows 更新。Apply the latest Windows updates. 这些更新可确保计算机包含最新的安全更新程序和 Visual Studio 所需的系统组件。These updates ensure that your computer has both the latest security updates and the required system components for Visual Studio.

  3. 重新启动。Reboot. 重新启动可确保挂起的任何安装或更新都不会影响 Visual Studio 安装。The reboot ensures that any pending installs or updates don't hinder the Visual Studio install.

  4. 释放空间。Free up space. 通过运行磁盘清理应用程序等方式,从 %SystemDrive% 删除不需要的文件和应用程序。Remove unneeded files and applications from your %SystemDrive% by, for example, running the Disk Cleanup app.

若对如何并行运行旧版 Visual Studio 和 Visual Studio 2017 有疑问,请参阅 Visual Studio 兼容性详细信息For questions about running previous versions of Visual Studio side by side with Visual Studio 2017, see the Visual Studio compatibility details.

有关使用 Visual Studio 2019 并排运行 Visual Studio 先前版本的问题,请参阅 Visual Studio 2019 平台目标和兼容性页面。For questions about running previous versions of Visual Studio side by side with Visual Studio 2019, see the Visual Studio 2019 Platform Targeting and Compatibility page.

第 2 步 - 下载 Visual StudioStep 2 - Download Visual Studio

接下来,下载 Visual Studio 引导程序文件。Next, download the Visual Studio bootstrapper file.

若要获取 Visual Studio 2017 的引导程序,请参阅 Visual Studio 早期版本下载页,获取关于如何执行此操作的详细信息。To get a bootstrapper for Visual Studio 2017, see the Visual Studio previous versions download page for details on how to do so.

为此,请选择下面的按钮,选择所需的 Visual Studio 版本,选择“保存”,然后选择“打开文件夹” 。To do so, choose the following button, choose the edition of Visual Studio that you want, choose Save, and then choose Open folder.

第 3 步 - 打开 Visual Studio 安装程序Step 3 - Install the Visual Studio installer

运行引导程序文件以安装 Visual Studio 安装程序。Run the bootstrapper file to install the Visual Studio Installer. 这个新的轻型安装程序包括安装和自定义 Visual Studio 所需的一切。This new lightweight installer includes everything you need to both install and customize Visual Studio.

  1. 在“下载” 文件夹中,双击与下列文件之一匹配或类似的引导程序文件:From your Downloads folder, double-click the bootstrapper that matches or is similar to one of the following files:

    • 对于 Visual Studio Community,请运行 vs_community.exevs_community.exe for Visual Studio Community
    • 对于 Visual Studio Professional,请运行 vs_professional.exevs_professional.exe for Visual Studio Professional
    • 对于 Visual Studio Enterprise,请运行 vs_enterprise.exevs_enterprise.exe for Visual Studio Enterprise

    如果收到用户帐户控制通知,请选择“是” 。If you receive a User Account Control notice, choose Yes.

  2. 我们会要求确认 Microsoft 许可条款和 Microsoft 隐私声明We'll ask you to acknowledge the Microsoft License Terms and the Microsoft Privacy Statement. 选择“继续” 。Choose Continue.

    许可条款和隐私声明License Terms and Privacy Statement

第 4 步 - 选择工作负载Step 4 - Choose workloads

安装该安装程序后,可以通过选择所需的功能集或工作负载来使用该程序自定义安装。After the installer is installed, you can use it to customize your installation by selecting the feature sets—or workloads—that you want. 操作方法如下。Here's how.

  1. 在“Visual Studio 安装程序” 中找到所需的工作负载。Find the workload you want in the Visual Studio Installer.

    Visual Studio 2017:安装工作负载

    例如,选择“.NET 桌面开发”工作负载。For example, choose the ".NET desktop development" workload. 它附带默认核心编辑器,该编辑器针对超过 20 种语言提供基本代码编辑支持,能够打开和编辑任意文件夹中的代码(而无需使用项目),还提供集成的源代码管理。It comes with the default core editor, which includes basic code editing support for over 20 languages, the ability to open and edit code from any folder without requiring a project, and integrated source code control.

  2. 选择所需的工作负载后,选择“安装” 。After you choose the workload(s) you want, choose Install.

    接下来,会出现多个显示 Visual Studio 安装进度的状态屏幕。Next, status screens appear that show the progress of your Visual Studio installation.

  1. 在“Visual Studio 安装程序” 中找到所需的工作负载。Find the workload you want in the Visual Studio Installer.

    Visual Studio 2019:安装工作负载

    例如,选择“ASP.NET 和 Web 开发”工作负载。For example, choose the "ASP.NET and web development" workload. 它附带默认核心编辑器,该编辑器针对超过 20 种语言提供基本代码编辑支持,能够打开和编辑任意文件夹中的代码(而无需使用项目),还提供集成的源代码管理。It comes with the default core editor, which includes basic code editing support for over 20 languages, the ability to open and edit code from any folder without requiring a project, and integrated source code control.

  2. 选择所需的工作负载后,选择“安装” 。After you choose the workload(s) you want, choose Install.

    接下来,会出现多个显示 Visual Studio 安装进度的状态屏幕。Next, status screens appear that show the progress of your Visual Studio installation.

Tip

在安装之后,可以随时安装最初未安装的工作负荷或组件。At any time after installation, you can install workloads or components that you didn't install initially. 如果已打开 Visual Studio,请转到“工具” > “获取工具和功能...” ,这会打开 Visual Studio 安装程序。If you have Visual Studio open, go to Tools > Get Tools and Features... which opens the Visual Studio Installer. 或者,从“开始”菜单打开“Visual Studio 安装程序” 。Or, open Visual Studio Installer from the Start menu. 在此处可以选择要安装的工作负载或组件。From there, you can choose the workloads or components that you wish to install. 然后,选择“修改” 。Then, choose Modify.

第 5 步 - 选择各个组件(可选)Step 5 - Choose individual components (Optional)

如果不想使用工作负载功能来自定义 Visual Studio 安装,或者想要添加比工作负载安装更多的组件,可通过从“各个组件”选项卡上安装或添加各个组件来完成此操作 。选择所需组件,然后按照提示进行操作。If you don't want to use the Workloads feature to customize your Visual Studio installation, or you want to add more components than a workload installs, you can do so by installing or adding individual components from the Individual components tab. Choose what you want, and then follow the prompts.

Visual Studio 2017 - 安装各个组件Visual Studio 2017 - Install individual components

Visual Studio 2019 - 安装各个组件Visual Studio 2019 - Install individual components

第 6 步 - 安装语言包(可选)Step 6 - Install language packs (Optional)

默认情况下,安装程序首次运行时会尝试匹配操作系统语言。By default, the installer program tries to match the language of the operating system when it runs for the first time. 若要以所选语言安装 Visual Studio,请从 Visual Studio 安装程序中选择“语言包”选项卡,然后按照提示进行操作 。To install Visual Studio in a language of your choosing, choose the Language packs tab from the Visual Studio Installer, and then follow the prompts.

Visual Studio 2017 - 安装语言包Visual Studio 2017 - Install language packs

Visual Studio 2019 - 安装语言包Visual Studio 2019 - Install language packs

从命令行更改安装程序语言Change the installer language from the command line

更改默认语言的另一种方法是从命令行运行安装程序。Another way that you can change the default language is by running the installer from the command line. 例如,可以通过运行以下命令来强制安装程序用英语运行:vs_installer.exe --locale en-USFor example, you can force the installer to run in English by using the following command: vs_installer.exe --locale en-US. 安装程序下一次运行时会记住此设置。The installer will remember this setting when it is run the next time. 安装程序支持以下语言标记:zh-cn、zh-tw、cs-cz、en-us、es-es、fr-fr、de-de、it-it、ja-jp、ko-kr、pl-pl、pt-br、ru-ru 和 tr-tr。The installer supports the following language tokens: zh-cn, zh-tw, cs-cz, en-us, es-es, fr-fr, de-de, it-it, ja-jp, ko-kr, pl-pl, pt-br, ru-ru, and tr-tr.

第 7 步 - 选择安装位置(可选)Step 7 - Select the installation location (Optional)

15.7 中的新增功能:现在可减少系统驱动器上 Visual Studio 的安装量。New in 15.7: You can now reduce the installation footprint of Visual Studio on your system drive. 可以选择将下载缓存、共享组件、SDK 和工具移动到不同驱动器,并将 Visual Studio 安装在其运行速度最快的驱动器上。You can choose to move the download cache, shared components, SDKs, and tools to different drives, and keep Visual Studio on the drive that runs it the fastest.

Visual Studio 2017 - 更改安装位置Visual Studio 2017 - Change installation locations

可减少系统驱动器上 Visual Studio 的安装占用。You can reduce the installation footprint of Visual Studio on your system drive. 可以选择将下载缓存、共享组件、SDK 和工具移动到不同驱动器,并将 Visual Studio 安装在其运行速度最快的驱动器上。You can choose to move the download cache, shared components, SDKs, and tools to different drives, and keep Visual Studio on the drive that runs it the fastest.

Visual Studio 2019 - 选择安装位置Visual Studio 2019 - Select installation locations

Important

仅当首次安装 Visual Studio 时,才可选择其他驱动器。You can select a different drive only when you first install Visual Studio. 如果已安装 Visual Studio 并要更改驱动器,则必须先将其卸载然后再重新安装。If you've already installed it and want to change drives, you must uninstall Visual Studio and then reinstall it.

有关详细信息,请参阅选择安装位置页面。For more information, see the Select installation locations page.

第 8 步 - 开始开发Step 8 - Start developing

  1. 在 Visual Studio 安装完成后,选择“启动”按钮,开始使用 Visual Studio 进行开发 。After Visual Studio installation is complete, choose the Launch button to get started developing with Visual Studio.

  2. 选择“文件”,然后选择“新建项目” 。Choose File, and then choose New Project.

  3. 选择一种项目类型。Select a project type.

    例如,若要生成 C++ 应用,请选择“已安装”,展开“Visual C++”,然后选择要生成的 C++ 项目类型 。For example, to build a C++ app, choose Installed, expand Visual C++, and then choose the C++ project type that you want to build.

    若要生成 C# 应用,请选择“已安装”,展开“Visual C#”,然后选择要生成的 C# 项目类型 。To build a C# app, choose Installed, expand Visual C#, and then choose the C# project type that you want to build.

  1. 在 Visual Studio 安装完成后,选择“启动”按钮,开始使用 Visual Studio 进行开发 。After Visual Studio installation is complete, choose the Launch button to get started developing with Visual Studio.

  2. 在“开始”窗口上,选择“创建新项目” 。On the start window, choose Create a new project.

  3. 在搜索框中,输入要创建的应用类型,查看可用模板列表。In the search box, enter the type of app you want to create to see a list of available templates. 模板列表取决于在安装期间选择的工作负载。The list of templates depends on the workload(s) that you chose during installation. 若要查看其他模板,请选择其他工作负载。To see different templates, choose different workloads.

    此外,还可使用“语言”下拉列表筛选搜索特定编程语言 。You can also filter your search for a specific programming language by using the Language drop-down list. 也可使用“平台”列表和“项目类型”列表进行筛选 。You can filter by using the Platform list and the Project type list, too.

  4. Visual Studio 会打开新的项目,然后便可开始编码!Visual Studio opens your new project, and you're ready to code!

获取支持Get support

有时,你难免遇到一些问题。Sometimes, things can go wrong. 如果 Visual Studio 安装失败,请参阅 Visual Studio 安装和升级问题疑难解答获取分步指南。If your Visual Studio installation fails, see Troubleshoot Visual Studio installation and upgrade issues for step-by-step guidance.

对于安装相关问题,我们还提供实时聊天 (仅限英语)支持选项。We also offer a live chat (English only) support option for installation-related issues.

下面是另外几个支持选项:Here are a few more support options:

请参阅See also