请将 Visual Studio 更新到最新版本Update Visual Studio to the most recent release

建议更新到最新版本的 Visual Studio 2017,以便始终获得最新功能、修复和改进。We encourage you to update to the most recent release of Visual Studio 2017 so that you always get the latest features, fixes, and improvements.

若要体验最新版本,建议下载并安装 Visual Studio 2019And if you'd like to try out our newest version, consider downloading and installing Visual Studio 2019 instead.

重要

若要安装、更新或修改 Visual Studio,必须使用具有管理权限的帐户登录。You must log on with an account that has administrative permissions to install, update, or modify Visual Studio. 有关详细信息,请参阅用户权限与 Visual StudioFor more information, see User Permissions and Visual Studio.

备注

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

更新 Visual Studio 2017 版本 15.6 或更高版本Update Visual Studio 2017 version 15.6 or later

已经简化了安装和更新体验,以便更轻松地在 IDE 中直接使用。We've streamlined the installation and update experience to make it easier to use directly from within the IDE. 下面介绍了如何从版本 15.6 以及更高版本更新到较新版本的 Visual Studio。Here's how to update from version 15.6 and later to newer versions of Visual Studio.

使用“通知”中心Using the Notifications hub

当有更新时,Visual Studio 中会有相应的“通知”标志。When there's an update, there's a corresponding notification flag in Visual Studio.

  1. 保存所有内容。Save your work.

  2. 选择“通知”标志打开“通知” 中心,然后选择要安装的更新。Choose the notification flag to open the Notifications hub, and then choose the update that you want to install.

    使用通知中心更新 Visual Studio 2017Update Visual Studio 2017 by using the Notification hub

    提示

    Visual Studio 2017 版本的更新是累积的,因此始终选择安装具有最新版本号的版本。An update for an edition of Visual Studio 2017 is cumulative, so always choose to install the one with the most recent version number.

  3. 当“更新” 对话框打开,请选择“立即更新” 。When the Update dialog box opens, choose Update Now.

    使用通知中心的“更新”对话框更新 Visual Studio 2017Update Visual Studio 2017 by using the Update dialog box from the Notifications hub

    如果“用户访问控制”对话框打开,选择“是” 。If a User Access Control dialog box opens, choose Yes. 接下来,“请稍候”对话框可能会打开一段时间,然后 Visual Studio 安装程序会打开以启动更新。Next, a "Please wait" dialog might open for a moment, and then the Visual Studio Installer opens to start the update.

    版本 15.6 中的新 Visual Studio 安装程序体验The new Visual Studio Installer experience in version 15.6

    更新将继续。Your update continues. 然后,完成时,将重新启动 Visual Studio。Then, when it's complete, Visual Studio restarts.

    备注

    当以管理员模式运行 Visual Studio 时,必须在更新后手动重启 Visual Studio。When you run Visual Studio in administrator mode, you must manually restart Visual Studio after the update.

使用 IDEUsing the IDE

可以查看更新,然后从 Visual Studio 菜单栏安装更新。You can check for an update and then install the update from the menu bar in Visual Studio.

  1. 保存所有内容。Save your work.

  2. 选择“帮助” >“检查更新” 。Choose Help > Check for Updates.

    Visual Studio 版本 15.6 中的新“帮助”菜单The new Help menu in Visual Studio version 15.6

  3. 当“更新” 对话框打开,请选择“立即更新” 。When the Update dialog box opens, choose Update Now.

    更新将启动(如上一节中所述),然后 Visual Studio 会在更新成功完成后重启。The update proceeds as described in the previous section, and then Visual Studio restarts after the update completes successfully.

    备注

    当以管理员模式运行 Visual Studio 时,必须在更新后手动重启 Visual Studio。When you run Visual Studio in administrator mode, you must manually restart Visual Studio after the update.

使用 Visual Studio 安装程序Using the Visual Studio Installer

和 Visual Studio 的早期版本一样,可以使用 Visual Studio 安装程序来安装更新。As in earlier versions of Visual Studio, you can use the Visual Studio Installer to install an update.

  1. 保存所有内容。Save your work.

  2. 打开安装程序。Open the installer. Visual Studio 安装程序可能需要更新才能继续。The Visual Studio Installer might require updating before you continue.

    备注

    在运行 Windows 10 的计算机上,可以在字母“V” 下找到“Visual Studio 安装程序” ,也可以在字母“M” 下找到“Microsoft Visual Studio 安装程序” 。On a computer running Windows 10, you can find the installer under the letter V as the Visual Studio Installer, or under the letter M as the Microsoft Visual Studio Installer.

  3. 在安装程序中的“产品” 页上,查找先前已安装的 Visual Studio 版本。On the Product page in the installer, look for the edition of Visual Studio that you installed previously.

  4. 若有更新,会看到“更新” 按钮。If an update is available, you see an Update button. (可能需要等待几秒钟的时间,安装程序才能确定是否有更新。)(It might take a few seconds for the installer to determine whether an update is available.)

    选择“更新” 按钮来安装更新。Choose the Update button to install the updates.

    使用 Visual Studio 安装程序更新 Visual Studio 2017Update Visual Studio 2017 by using the Visual Studio Installer

更新 Visual Studio 2017 版本 15.5 或更早版本Update Visual Studio 2017 version 15.5 or earlier

如果使用的是早期版本,下面将介绍如何应用从 Visual Studio 2017 版本 15.0 到版本 15.5 的更新。If you're using an earlier version, here's how to apply an update from Visual Studio 2017 version 15.0 through version 15.5.

使用“通知”中心进行更新Update by using the Notifications hub

  1. 当有更新时,Visual Studio 中会有相应的“通知”标志。When there are updates, there's a corresponding notification flag in Visual Studio.

    使用通知中心更新 Visual Studio 2017Update Visual Studio 2017 by using the Notification hub

    选择通知标志,打开“通知” 中心。Choose the notification flag to open the Notifications hub.

    使用通知中心更新 Visual Studio 2017Update Visual Studio 2017 by using the Notification hub

    提示

    Visual Studio 2017 版本的更新是累积的,因此始终选择安装具有最新版本号的版本。An update for an edition of Visual Studio 2017 is cumulative, so always choose to install the one with the most recent version number.

  2. 选择“有‘Visual Studio 更新’” ,随即会打开“扩展和更新” 对话框。Choose "Visual Studio Update" is available, which opens the Extensions and Updates dialog box.

    使用通知中心更新 Visual Studio 2017Update Visual Studio 2017 by using the Notifications hub

  3. 在“扩展和更新” 对话框中,选择“更新” 按钮。In the Extensions and Updates dialog box, choose the Update button.

    使用通知中心更新 Visual Studio 2017Update Visual Studio 2017 by using the Notifications hub

Visual Studio 通知的详细信息More about Visual Studio notifications

Visual Studio 自身或安装的任何组件有更新时,以及 Visual Studio 环境中发生某些事件时,Visual Studio 都会通知你。Visual Studio notifies you when an update is available for Visual Studio itself or for any components, and also when certain events occur in the Visual Studio environment.

  • 通知标志呈黄色时,表示有 Visual Studio 产品更新可供安装。When the notification flag is yellow, there's a Visual Studio product update available for you to install.
  • 通知标志呈红色时,表示许可证有问题。When the notification flag is red, there's a problem with your license.
  • 通知标志呈黑色时,表示有要查看的可选消息或信息性消息。When the notification flag is black, there are optional or informational messages to review.

选择通知标志,打开“通知” 中心,然后选择想要对其执行操作的通知。Choose the notifications flag to open the Notifications hub and then choose the notifications that you want to act on. 或选择忽略或消除通知。Or, choose to ignore or dismiss a notification.

查看通知中心中的可选消息或信息性消息View an optional or informational message in the Notification hub

如果选择忽略通知,Visual Studio 将不再显示它。If you choose to ignore a notification, Visual Studio stops showing it. 如果要重置忽略通知的列表,请选择“通知”中心中的“设置” 按钮。If you want to reset the list of ignored notifications, choose the Settings button in the Notifications hub.

选择通知中心的“设置”按钮查看“通知”选项Choose the Settings button in the Notifications hub to view Notification options

使用 Visual Studio 安装程序进行更新Update by using the Visual Studio Installer

  1. 打开安装程序。Open the installer. 可能需要先更新安装程序,然后才能继续操作。You might need to update the installer before continuing. 如果是这种情况,系统会提示你更新安装程序。If this is the case, you're prompted to do so.

    备注

    在运行 Windows 10 的计算机上,可以在字母“V” 下找到“Visual Studio 安装程序” ,也可以在字母“M” 下找到“Microsoft Visual Studio 安装程序” 。On a computer running Windows 10, you can find the installer under the letter V as the Visual Studio Installer, or under the letter M as the Microsoft Visual Studio Installer.

  2. 在安装程序中的“产品” 页上,查找先前已安装的 Visual Studio 版本。On the Product page in the installer, look for the edition of Visual Studio that installed previously.

  3. 若有更新,会看到“更新” 按钮。If an update is available, you see an Update button. (可能需要等待几秒钟的时间,安装程序才能确定是否有更新。)(It might take a few seconds for the installer to determine whether an update is available.)

    选择“更新” 按钮来安装更新。Choose the Update button to install the updates.

    使用 Visual Studio 安装程序更新 Visual Studio 2017Update Visual Studio 2017 by using the Visual Studio Installer

建议更新到最新版本的 Visual Studio 2019,以便始终获得最新功能、修复和改进。We encourage you to update to the most recent release of Visual Studio 2019 so that you always get the latest features, fixes, and improvements.

如果尚未安装 Visual Studio 2019,请转到 Visual Studio 下载页免费安装。If you haven't already installed Visual Studio 2019, go to the Visual Studio downloads page to install it for free. 如果当前使用其他版本的 Visual Studio,可以并行安装 Visual Studio 版本卸载以前版本的 Visual StudioIf you are currently using a different version of Visual Studio, you can either install Visual Studio versions side-by-side, or uninstall previous versions of Visual Studio.

重要

若要安装、更新或修改 Visual Studio,必须使用具有管理权限的帐户登录。You must log on with an account that has administrative permissions to install, update, or modify Visual Studio. 有关详细信息,请参阅用户权限与 Visual StudioFor more information, see User Permissions and Visual Studio.

备注

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

下面是 Visual Studio 2019 的更新方法。Here's how to update Visual Studio 2019.

使用 Visual Studio 安装程序Use the Visual Studio Installer

  1. 打开安装程序。Open the installer.

    在 Windows 中打开 Visual Studio 安装程序Open the Visual Studio Installer from Windows

    可能需要先更新安装程序,然后才能继续操作。You might have to update the installer before continuing. 如果是这样,请按照提示操作。If so, follow the prompts.

  2. 在安装程序中,查找已安装的 Visual Studio 版本。In the installer, look for the edition of Visual Studio that you installed.

    例如,如果以前安装了 Visual Studio Community 2019,并且具有该版本的更新,则安装程序中将显示“更新可用”消息。 For example, if you previously installed Visual Studio Community 2019 and there's an update for it, then an Update available message appears in the installer.

    选择要更新的 Visual Studio 2019 版本Select the edition of Visual Studio 2019 that you want to update

  3. 选择“更新”,以安装更新 。Choose Update to install the updates.

    选择“更新”按钮来安装更新Select the Update button to install the updates

  4. 更新完成后,系统可能会要求你重新启动计算机。After the update is complete, you might be asked to restart your computer. 如果是这样,请执行该操作,然后像往常一样启动 Visual Studio。If so, do so, and then start Visual Studio as you typically would.

    如果系统不要求你重新启动计算机,请选择“启动” 以从安装程序启动 Visual Studio。If you aren't asked to restart your computer, choose Launch to start Visual Studio from the installer.

    选择“启动”按钮启动 Visual StudioSelect the Launch button to start Visual Studio

使用 IDEUse the IDE

可以查看更新,然后使用 Visual Studio 2019 中的菜单栏或搜索框安装更新。You can check for an update and then install it by using the menu bar or the search box in Visual Studio 2019.

打开 Visual StudioOpen Visual Studio

  1. 在 Windows“开始” 菜单上,选择“Visual Studio 2019” 。From the Windows Start menu, choose Visual Studio 2019.

    打开 Visual Studio 2019Open Visual Studio 2019

  2. 在“开始使用”下,选择任意选项以打开 IDE 。Under Get started, choose any option to open the IDE.

    打开 Visual Studio 安装程序Open the Visual Studio Installer

    Visual Studio 随即打开。Visual Studio opens. 在 IDE 中,将显示“Visual Studio 2019 更新”消息 。In the IDE, a Visual Studio 2019 update message appears.

    IDE 中的“Visual Studio 2019 更新”消息The 'Visual Studio 2019 update' message in the IDE

  3. 在“Visual Studio 2019 更新”消息中,选择“查看详细信息” 。In the Visual Studio 2019 update message, choose View details.

    在“Visual Studio 2019 IDE 更新”消息中,选择“查看详细信息”按钮Choose View Details button in the Visual Studio 2019 IDE update message

  4. 在“已下载更新并准备安装”对话框中,选择“更新” 。In the Update downloaded and ready to install dialog box, choose Update.

    在“已下载更新并准备安装”对话框中,选择“更新”按钮Choose the Update button in the 'Update downloaded and ready to install' dialog box

    Visual Studio 将更新、关闭然后重新打开。Visual Studio updates, closes, and then reopens.

在 Visual Studio 中In Visual Studio

  1. 在菜单栏上,选择“帮助” ,然后选择“检查更新” 。From the menu bar, choose Help, and then choose Check for Updates.

    从“帮助”菜单中选择“检查更新”Choose 'Check for Updates' from the Help menu

    备注

    还可以使用 IDE 中的搜索框来检查更新。You can also use the search box in the IDE to check for updates. 按 Ctrl +Q ,键入“检查更新”,然后选择匹配的搜索结果。Press Ctrl+Q, type "check for updates", and then choose the search result that matches.

  2. 在“更新可用” 对话框中,选择“更新” 。In the Update available dialog box, choose Update.

    在“已下载更新并准备安装”对话框中,选择“更新”按钮Choose the Update button in the 'Update downloaded and ready to install' dialog box

    Visual Studio 将更新、关闭然后重新打开。Visual Studio updates, closes, and then reopens.

使用“通知”中心Use the Notifications hub

  1. 在 Visual Studio 中,保存所做的工作。In Visual Studio, save your work.

  2. 从 Visual Studio IDE 的右下角选择通知图标,以打开“通知” 中心。Choose the notification icon from the lower-right corner of the Visual Studio IDE to open the Notifications hub.

    Visual Studio IDE 中的通知图标The notification icon in the Visual Studio IDE

  3. 在“通知中心” 中,选择要安装的更新,然后选择“查看详细信息” 。In the Notifications hub, choose the update that you want to install, and then choose View details.

    Visual Studio 2019 中的通知中心The Notification hub in Visual Studio 2019

    提示

    Visual Studio 2019 版本的更新是累积的,因此始终选择安装具有最新版本号的版本。An update for an edition of Visual Studio 2019 is cumulative, so always choose to install the one with the most recent version number.

  4. 在“更新可用” 对话框中,选择“更新” 。In the Update available dialog box, choose Update.

    Visual Studio 将更新、关闭然后重新打开。Visual Studio updates, closes, and then reopens.

自定义更新设置Customize update settings

可以通过几种不同的方式在 Visual Studio 中自定义更新设置,比如更改安装模式和选择自动下载。You can customize the update settings in Visual Studio in several different ways, such as by changing the installation mode and by selecting automatic downloads.

有两种安装模式可供选择:There are two installation modes to choose from:

  • 在下载时安装Install while downloading
  • 全部下载后再安装Download all, then install

还可以选择“自动下载更新” 设置,该设置允许在计算机处于空闲状态时下载更新。You can also choose the Automatically download updates setting, which allows updates to download while your machine is idle.

操作方法如下:Here's how:

  1. 在菜单栏上,依次选择“工具” >“选项” 。On the menu bar, choose Tools > Options.

  2. 展开“环境” ,然后选择“生产更新” 。Expand Environment, and then choose Product Updates.

    Visual Studio 中的更新设置

  3. 选择安装模式和 Visual Studio 更新所需的自动下载选项。Choose the installation mode and the automatic download options you want for your Visual Studio updates.

获取支持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 an installation chat (English only) support option for installation-related issues.

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

另请参阅See also