2019 年版本 16.10.0 Visual Studio版本中的新增功能摘要Summary of What's New in this Release of Visual Studio 2019 version 16.10.0
C++C++
· 所有 C++20 功能现已在 开关 /std:c++latest 下提供。All C++20 features are now available under the /std:c++latest switch. 尽管 MSVC 目前由 ISO) 发布的 C++20 标准 (的实现已完成,但一些关键的 C++20 库功能预期会由即将推出的缺陷报告 (ISO C++20 bug 修复) 来修正,这些修复可能会以 ABI 不兼容的方式更改它们。While MSVC’s implementation of the C++20 standards (as currently published by ISO) is feature complete, some key C++20 library features are expected to be amended by upcoming Defect Reports (ISO C++20 bug fixes) that may change them in an ABI-incompatible way. 请参阅 Microsoft/STL 问题#1814 了解更多详细信息。Please see Microsoft/STL Issue #1814 for more details.
o 16.10 中已添加 C++20 即时函数和 constinit 支持C++20 immediate functions & constinit support added in 16.10
o 新时钟、闰秒、时区和解析的最后几部分The final pieces of : new clocks, leap seconds, time zones, and parsing
o 文本格式化的实现Implementation of for text formating
· 除了 x64 之外,/openmp:llvm 现已在 x86 和 ARM64 上推出/openmp:llvm is now available on x86 and ARM64, in addition to x64
· 现可使用自定义编译警告等级和代码分析设置将包含目录指定为外部目录。Include directories can now be designated as external with customized compilation warning levels and code analysis settings.
· 添加了 /await:strict 开关以在以前的语言模式下启用 C++20 样式协同例程。Added the /await:strict switch to enable C++20-style coroutines in earlier language modes.
· std::coroutine_handle 的调试程序可视化效果现在可显示原始协同例程函数名、签名和当前挂起点。Debugger visualization of std::coroutine_handle now displays the original coroutine function name and signature and the current suspend point.
· 新增了对 CMakePresets 的支持。Added support for CMakePresets.
· 现在,在 Visual Studio 中添加新的远程连接时,需要接受或拒绝由服务器提供的主机密钥指纹。You will now be required to accept or deny the host key fingerprint presented by the server when adding a new remote connection in Visual Studio.
· 向 MSVC 添加了一个 /external 开关,用于指定出于警告目的哪个标头应被视为外部标头。Added an /external switch to MSVC for specifying headers which should be treated as external for warning purposes.
Docker 工具改进Docker Tools improvements
· 能够创建一个启动配置文件,用于配置将在 Compose 文件中启动的服务。Ability to create a launch profile that configures which services to start in your Compose file.
· 能够标记映像。Ability to tag an image.
· 添加了适用于容器的“卷”选项卡。Added a Volumes tab for containers.
· 添加了适用于容器的“标签”选项卡。Added a Labels tab for containers.
· 添加了适用于映像的“标签”选项卡。Added a Labels tab for images.
· 容器现在按 Compose 项目分组。Containers are now grouped by Compose project.
编辑器Editor
· 如果用户想要不那么拥挤的体验,可以通过在 Visual Studio 搜索 (Ctrl+Q) 中搜索“行距”来修改行行距。For folks who want a less crowded experience, line spacing can be modified by searching for "line spacing" in Visual Studio Search (Ctrl+Q). 该选项位于“文本编辑器”\“常规”下。The option is under Text Editor\General.
· “在文件中查找”和“查找所有引用”具有可以保存结果的控件。Find in Files and Find all References have a control to keep results. 根据社区的反馈,我们添加了一个选项,用于在默认情况下开启“保存结果”选项。Based on feedback from our community, we've added an option to toggle the "Keep Results" option to on by default. 通过在 Visual Studio 搜索 (Ctrl + Q) 中搜索“默认保存搜索结果”可以找到此选项。This option can be found by searching for "keep search results by default" in Visual Studio Search (Ctrl+Q). 该选项位于“环境”\“查找和替换”下。The option is under Environment\Find and Replace. 请注意,用户当前使用“在文件中查找”只能获得 5 个结果,而使用“查找所有引用”则可以多获得 5 个结果。Note that users are currently limited to 5 results for Find in Files and 5 more results for Find all References.
· “在文件中查找”有一个新选项可以让用户运行其他搜索,并将这些结果追加到以前的搜索中。A new option in Find in Files allows users to run additional searches and append those results to a previous search.
编辑器扩展性Editor Extensibility
· 管理 IntraTextAdornmentTags 的代码的行为已发生更改。The behavior of the code that manages IntraTextAdornmentTags has changed. 对待此更改应像对待任何其他 ITagger 一样,当基础标记发生变化时,你也必须引发标记已更改事件。With this change, just like with any other ITagger, you must raise a tags changed event when the underlying tags change. 否则,相应标记可能永远不会更新。Otherwise, your tags may never be updated.
调试和诊断Debugging & Diagnostics
· 内存转储的诊断分析现在包括托管 Linux 核心转储。Diagnostic Analysis of memory dumps now includes Managed Linux core dumps.
Git 效率Git Productivity
· 通过深层链接跳转到 Web 以创建新的拉取请求,并查看 GitHub 上的拉取请求或 Git 菜单中的 Azure DevOps。Jump to the web with deep links to create a new pull request and view PRs on GitHub or Azure DevOps from the Git menu.
· 只需从分支选取器中选择一个分支,即可签出本地和远程分支。Checkout local and remote branches with a single select from the branch picker.
· 通过上下文菜单从存储库选取器中删除项。Remove items from the repository picker through the context menu.
· 通过“Git”>“设置”开启相应功能,以便在打开 Git 存储库时自动加载解决方案。Turn on automatic loading of the solution when opening a Git repository through Git > Settings.
· 通过“Git”>“设置”切换双击签出“Git 存储库”窗口中分支的行为。Toggle behavior of double-clicking to check out branches from the Git Repository window through Git > Settings.
· 将你的分支与“Git 更改”窗口溢出菜单中的多个远程分支进行同步(先“拉取”后“推送”)。Sync (Pull then Push) your branch with multiple remotes from the Git Changes window overflow menu.
· 自定义“Git 更改”窗口溢出菜单中可见的工具栏操作(提取、拉取、推送、同步)。Customize your visible Git Changes window toolbar actions (Fetch, Pull, Push, Sync) from the overflow menu.
· 在浏览器中从“Git 更改”窗口的溢出菜单打开存储库。Open your repository in the browser from the Git Changes window overflow menu.
· 在状态栏中搜索和签出本地分支和远程库分支。Search and checkout local and remote branches from the status bar.
· 在状态栏中搜索并切换本地 Git 存储库。Search and switch between local Git repositories from the status bar.
· 修复了在 Visual Studio 启动时 Git 菜单中的本地存储库列表不加载的问题。Fixed an issue where local repositories list in the Git menu wasn't loading on Visual Studio launch.
· 打开存储库时,将嵌套项目子存储库添加到本地存储库列表。Add nested project sub-repos to your local repositories list when opening a repository.
· 在通过“Git”>“设置”切换存储库时,将解决方案保持打开状态。Keep solution open when switching repositories through Git > Settings.
· 在通过“Git”>“设置”打开存储库时,关闭打开的文件夹。Turn off open folder when opening repositories through Git > Settings.
· 通过状态栏中的“未推送的提交”按钮和 Git 菜单中的“同步”命令中将分支与远程库同步。Sync your branch with the remote from the unpushed commits button in the status bar, and from the Sync command in Git Menu.
· 即使没有传入的提交,也可以从“Git 存储库”窗口的“历史记录”窗格中提取和拉取。Fetch and pull from the Git Repository window history pane even when there are no incoming commits.
· 查看“Git 存储库”窗口中嵌入的提交详细信息和文件更改比较。View Commit Details and the comparison of file changes embedded in the Git Repository window.
· 打开 Azure DevOps Git 存储库时,自动重新连接或提示建立初始 Azure DevOps 连接。Automatically re-connect or prompt to establish initial Azure DevOps connection when opening an Azure DevOps Git repository.
· 对可见的分支名称进行合并和变基,替换混乱的源/目标术语。Merge and rebase with visible branch names, replacing confusing Source / Target terminology.
· 改进了解决方案资源管理器中的源代码管理字形的性能和可靠性。Improved performance and reliability for source control glyphs in Solution Explorer.
· 保留“Git 存储库”窗口中的传入/传出部分,即使是空的。Preserve incoming/outgoing sections in Git Repository window even when empty.
· 将“Git 更改”窗口中多个远程库的“提取”/“拉取”/“推送”下拉列表合并为一个“操作”菜单。Consolidated Fetch/Pull/Push dropdowns for multiple remotes in Git Changes window to a single Action menu.
.NET 效率.NET Productivity
· 方法调用中的参数补全Argument completion in method calls
· EditorConfig UIEditorConfig UI
· 目视检查并浏览继承链Visually inspect and navigate the inheritance chain
· 对强制转换、索引器和运算符的 IntelliSense 补全IntelliSense completion for casts, indexers, and operators
· 对源生成器的调试器支持Debugger support for Source Generators
· 对 Visual Basic 的代码清理支持Code cleanup support for Visual Basic
· 编辑并继续 (EnC) 更新Edit and Continue (EnC) updates
· 删除未用引用Remove Unused References
· 智能换行Smart Break Line
· 简化 LINQ 表达式的重构Simplify LINQ expression refactoring
· 对 Enum 值进行 IntelliSense 补全IntelliSense completion for Enum values
· IntelliSense 补全模式设置IntelliSense completion mode setting
· 新行的代码样式首选项Code style preference for new lines
· 对源生成器的“查找所有引用”支持Find All References support for Source Generators
Razor (ASP.NET Core) 预览版编辑器Razor (ASP.NET Core) Preview Editor
· IntelliSense 补全的更新IntelliSense completion updates
· 对通用组件的“转到定义”支持Go to Definition support for generic components
· 制表符和空格的新代码样式配置New code style configuration for tabs and spaces
· “工具选项”中的 Razor 文本编辑器现在称为 Razor (ASP.NET Core)Razor text editor in Tools Options is now called Razor (ASP.NET Core)
测试体验辅助功能改进Test Experience Accessibility improvements
· Console.Writeline 现在显示在测试资源管理器中Console.Writeline now shows in the Test Explorer
· 测试输出现在可以保留标记,因此即使从日志文件中也可以浏览超链接和堆栈跟踪链接。Test output can now preserve tags so hyperlinks and stacktrace links are navigable even from the log files.
· 如果输出超过 300 个字符,或者附加到测试结果的文件超过 10 个,则会为单个测试结果创建日志文件。Log files are created for a single test result when output is over 300 characters or if there are over 10 files attached to the test result.
· 日志文件现在也可以在预览中打开,这样可以更轻松地管理选项卡。Log files can also now open in preview so it’s easier to manage your tabs.
· 日志文件和测试资源管理器支持按 Ctrl PgUp/PgDn 导航光标,并按 Shift + Ctrl PgUp/PgDn 进行选择。Log files and the Test Explorer support Ctrl PgUp/PgDn for navigating the cursor and Shift+Ctrl PgUp/PgDn for selection.
· 日志文件编辑器现在正在使用 IVsTextView 接口,这意味着它现在能够打开非常大的文本文件。The log file editor is now using the IVsTextView interface which means it will now be able to open very large text files. 这样,用户就无需 Copy All 截断日志并在记事本等单独的编辑器中打开它们。This should eliminate the need for users to Copy All truncated logs and open them in a separate editor such as Notepad. 对于 MSTest,我们现在还加入了一个聚合了所有输出的单个日志文件,而不是对每个数据行使用单独的日志文件。For MSTest, we now also include a single log file that aggregates all the output instead of only having individual log files for each data row.
· 现在,可以使用 dotnet cli 在 Ubuntu 和 Alpine 上的命令行获取跨平台代码覆盖率。You can now get cross-platform code coverage at the command-line on Ubuntu and Alpine with the dotnet cli. 对于想要在面向这些平台的计算机上获取代码覆盖率的用户,现在可以添加通常在 Windows 上使用的相同代码覆盖率集合命令。For users interested in getting code coverage on machines targeting those platforms you can now add the same code coverage collection commands that you'd normally use on windows. 请参阅 dotnet 测试 的更多文档。See more documentation for dotnet test.
· 现在,测试资源管理器中的"全部折叠"按钮旁边有一个"全部展开"按钮。There is now an expand all button next to the collapse all button in the Test Explorer. 可以通过键盘快捷方式使用此命令, (Ctrl+A、Ctrl+ 向右键) ,但更多反馈表明添加按钮值得额外 UI。This command has been available through keyboard shortcuts (Ctrl+A, Ctrl+ right arrow), but more feedback indicated adding a button was worth the additional UI.
· "测试资源管理器" 显示 "过期" 的方式也有一些细微的更改。There are also some slight changes to how the Test Explorer shows "staleness." "过期" 是灰显或 "褪色" 测试结果,指示结果不是来自最新的测试运行。"Staleness" is the grayed out or "faded" test results that indicate the result was not from the latest test run. 如果结果不是最近的测试运行的一部分,它将显示为过时。If a result is not a part of the most recent test run it will appear as stale. 以前,新的测试发现 (甚至是旧的重新发现) 的测试结果,也会显示纯色图标。Previously, new test discoveries (or even old test results that were rediscovered) were also shown with solid icons. 这会对某些 "未运行" 测试的情况产生一些混乱,并导致其他一些测试不是。This caused some confusion on why some 'Not Run' tests were faded and why others were not. 此更改将降低过期的复杂性。This change will reduce the complexity of staleness.
· 在版本16.2 中添加了持久测试结果功能 () 你可以查看上一次测试运行的测试结果,即使你已关闭并重新打开 Visual Studio。With the persisted test results feature (added in version 16.2) you can see test results from the last test run even if you've closed and re-opened Visual Studio. 这可以帮助用户记住其中断位置,并提供更多上下文,而无需另一次测试运行。This helps users remember where they left off and gives more context without requiring another test run. 我们还修改了持久结果的行为,因此它们将始终显示为过时。We also modified the behavior of persisted results so they will always appear stale. 这更好表明,它们并非来自在当前 Visual Studio 会话期间执行的测试运行。This better indicates that they were not from a test run that executed during the current Visual Studio session.
Web 工具:Web Tools:
· 切换到 API V2 进行 Azure AD 预配Switch to V2 of API for Azure AD provisioning
· 作为连接服务的 Azure 应用程序配置现在支持动态配置Azure App Configuration as a Connected Service now supports dynamic configuration
Windows 应用程序打包项目依赖项树Windows Application Packaging Project Dependencies Tree
· 向 WAP 项目添加了“依赖项树”Added a "Dependencies Tree" to the WAP Project
XAML 工具改进XAML Tooling Improvements
· 改进了适用于 Xamarin 的 XAML IntelliSense 和 XAML 热重载。 Forms 客户Improved XAML IntelliSense and XAML Hot Reload for Xamarin.Forms customers
· 在 WPF 中引入了 select ItemsControls 的XAML 示例数据Introduced XAML Sample Data for select ItemsControls in WPF
· 添加了新的灯泡以快速访问常用的属性Added new lightbulb for quick access to commonly edited properties
· 在 XAML 编辑器中添加了新的灯泡,以帮助创建视图模型Added new lightbulb in the XAML Editor to help create a view-model
Service Fabric 工具Service Fabric Tools
· Service Fabric 应用程序中引入 StartupServices.xml 简介Introducing StartupServices.xml in Service Fabric Applications
Visual Studio 2019 版本16.10 中的新增功能的详细信息Details of What's New in Visual Studio 2019 version 16.10
Docker 工具Docker Tools
容器工具窗口Containers Tool Window
在此版本中,我们升级了容器工具窗口,使其更容易查看和与容器和映像交互。In this release, we made additions to the Containers tool window to make it easier to view and interact with containers and images. 只需导航到“视图”>“其他 Windows”>“容器”,即可试用新功能。Just navigate to View > Other Windows > Containers to try out the new features.
· 容器现在按 Compose 项目分组。Containers are now grouped by Compose project. 这样可以很容易地判断哪些容器代表你的应用程序。This makes it simple to tell which containers represent your application. 此外,我们在容器中添加了“标签”选项卡,以便你可以轻松地查看在开发期间使用的标签。Also shown, we added a Labels tab in Containers so you can easily see which labels you are using during development.
Compose 分组选项和容器“标签”选项卡Compose grouping option and containers label tab
· 我们还添加了适用于映像的“标签”选项卡。We also added a Labels tab for images.
映像“标签”选项卡Imagese Label tab
· 使用新的“卷”选项卡可以查看正在运行的容器的卷,甚至可以在 Visual Studio 中打开这些文件。The new Volumes tab allows you to see the volumes of a running container and even open the files in Visual Studio.
容器“卷”选项卡Container Volumes tab
· 现在,我们支持在“容器”工具窗口中标记映像功能。We now support the ability to tag an image from the Containers tool window. 在“映像”中,右键单击映像并选择“标记” 。From Images, right-click an image and select Tag.
标记图像Tagging an image
撰写Compose
· 通过 Visual Studio 中的 Docker Compose 工具,现在可以运行 Compose 文件中定义的任何服务组合。Docker Compose tooling in Visual Studio now provides the ability to run any combination of services defined in your Compose files. 打开“调试”下拉菜单,或者右键单击 docker-compose 项目,选择“管理 Docker Compose 启动设置”即可开始。Either open the Debug dropdown or right-click on your docker-compose project and select Manage Docker Compose Launch Settings to get started.
管理 Docker Compose 启动设置Manage Docker Compose Launch Settings
Git 效率Git Productivity
· 为了更轻松地在 Visual Studio 中创建拉取请求,我们向网页添加了深层链接快捷方式的菜单项,你可使用这些菜单项创建 PR 或查看存储库的 PR 列表。To start making it easier to create pull requests while you're in Visual Studio, we added menu items that are deep link shortcuts to the webpages that allow you to create a PR or view a list of PRs for your repository. 菜单位置不固定,具体取决于存储库是位于 GitHub 还是 Azure DevOps。The menu is dynamic based on whether your repository is on GitHub or Azure DevOps.
从 Git 菜单创建 PR 并查看 Web 上的 PR 列表Create a PR and view list of PRs on the web from the Git menu
· 在选择单一分支时,状态栏和“Git 更改”窗口中的分支选取器现在会签出本地或远程分支。The branch picker in the status bar and the Git Changes window now checks out a local or remote branch when you single-select the branch. 你可在上下文菜单中找到其他操作。You can find additional actions in the context menu.
左键单击签出分支,然后右键单击以执行其他操作Left click to check out a branch and right click for additional actions
· 状态栏中的新存储库选取器在右键单击后会显示上下文菜单,你可使用此菜单从列表中删除项。The new repository picker in the status bar has a context menu on right-click that allows you to remove items from the list.
通过上下文菜单从存储库选取器列表中删除项Remove items from the repository picker list through the context menu
· 使用存储库选取器或 Git 菜单“本地存储库”列表时,打开存储库后,系统不再自动加载解决方案。When using the repository picker or Git menu Local Repositories list, opening a repository won’t automatically load the solution anymore. 相反,你将在可供选择的列表中看到文件夹视图和可获取的解决方案。You’ll instead see the folder view and solution available in a list you can select from. 通过“Git”>“设置”,你可借由切换复选框更改此行为。You can change this behavior through Git > Settings by toggling the checkbox.
· 通过双击分支名称,你可选择从“Git 存储库”窗口签出分支。You can choose to check out a branch from the Git Repository window by double-clicking the branch name. 如要更改此行为,请通过“Git”>“设置”切换复选框。If you want to change this behavior, then toggle the checkbox in Git > Settings.
用于切换自动加载和分支签出的设置Settings to toggle auto-sln load and branch check out
· 你现可从“Git 更改”窗口执行更多操作。You can perform even more actions now from the Git Changes window. 工具栏图标可以自定义,让你自行选择要显示的操作。The toolbar icons are customizable and you can choose which actions to show. 你可以与溢出菜单中的多个远程分支保持同步。You can Sync with multiple remotes from the overflow menu. 你可以在浏览器中打开存储库的远程网页。And you can open your repository’s remote webpage in the browser.
同步、在浏览器中打开并自定义“Git 更改”窗口中的工具栏操作Sync, open in browser, and customize toolbar actions from the Git Changes window
· 在状态栏分支选取器中搜索本地和远程库分支并执行常见分支操作。Search local and remote branches and perform common branch actions from the status bar branch picker.
状态栏中的分支选取器Branch picker in the status bar
· 在状态栏存储库选取器中搜索并切换本地 Git 存储库。Search and switch between local Git repositories from the status bar repository picker.
状态栏中的存储库选取器Repo picker in the status bar
· 修复了 Git 菜单中的本地存储库列表在 Visual Studio 启动时不加载的问题。Fixed an issue where the local repositories list in the Git menu wasn't loading on Visual Studio launch.
· 我们在“Git”>“设置”中添加了两个新选项,用于管理打开和切换存储库的方式。We added two new options in Git > Settings to manage how you open and switch repositories. 现在可以在切换到其他存储库时将当前解决方案保持打开状态
You can now keep the current solution open when switching to another repository
用于将当前解决方案保持打开状态的设置Setting to keep current solution open
· 还可以选择在打开存储库时不加载存储库根文件夹。You can also choose to not load the repository root folder when opening a repository.
用于打开文件夹的设置Setting to open the folder
· 通过状态栏中的“未推送的提交”按钮和 Git 菜单中的“同步”命令中将分支与远程库同步(拉取后推送)。Sync (Pull then Push) your branch with the remote from the unpushed commits button in the status bar, and from the Sync command in Git Menu.
状态栏中的“同步”按钮Sync button in the status bar
· 即使没有传入的提交,也可以从“Git 存储库”窗口的“历史记录”窗格中提取和拉取。Fetch and pull from the Git Repository window history pane even when there are no incoming commits. 在状态栏或使用键盘快捷方式 Ctrl+0+Y 访问这些部分。Access these sections from the status bar or the keyboard shortcut Ctrl+0+Y.
“Git 存储库”窗口中包含“提取”和“拉取”按钮的传入部分Incoming section in the Git Repository window with fetch and pull buttons
· 在“Git 存储库”窗口中选择“提交”可以查看其详细信息和文件更改的比较,而无需导航到其他窗口。Select a commit in the Git Repository window to view its details and the comparison of file changes without having to navigate to other windows. 选择两个提交并单击右键,在同一窗口中进行比较。Select two commits and right-click to compare them in the same window. 在他们自己的窗口中弹出详细信息,通过全屏模式深入了解这些更改。Pop out the details into their own window for full screen visibility to deep-dive into the changes.
“Git 存储库”窗口中的嵌入提交详细信息和文件比较Embedded commit details and file comparison in Git Repository window
· 查看文件中的删除和插入操作数,更改比较的布局。View the number of deletions and insertions in a file, and change the layout of the comparison.
弹出了多个“提交”窗口Popped out multiple Commit windows
· 打开 Azure DevOps Git 存储库时,自动重新连接或提示建立初始 Azure DevOps 连接。Automatically re-connect or prompt to establish initial Azure DevOps connection when opening an Azure DevOps Git repository. 这样,便可以访问打开的存储库的工作项和生成。This enables access to work items and builds for the opened repository.
在丢失时提示 Azure DevOps 初始连接的信息栏Info bar prompting Azure DevOps initial connection when missing
· 解决变基或合并冲突时,合并编辑器和上下文菜单将显示当前和传入分支的分支名称。When resolving rebase or merge conflicts, the merge editor and the context menu will show you the branch names for the Current and Incoming branches. 这修复了混乱的源和目标术语。This fixes the confusing Source and Target terminology.
解决冲突时上下文菜单显示分支名称Context menu when resolving conflicts displays the branch names
变基和合并编辑器在标题中显示分支名称Rebase and Merge editor displays branch names in the heading
.NET 效率.NET Productivity
· 添加了“删除未用引用”命令,便于清理未用的项目引用和 NuGet 包。We added a Remove Unused References command that allows you to clean up project references and NuGet packages that have no usage. 此选项默认处于禁用状态,因此你需要在“工具” > “选项” > “文本编辑器” > “C#” > “高级”中启用它,然后选中“在解决方案资源管理器(实验性)中显示‘删除未用引用’命令”。This option is off by default so you will need to enable it in Tools > Options > Text Editor > C# > Advanced and select Show “remove Unused References” command in Solution Explorer (experimental). 在启用此选项后,“删除未用引用”命令就会显示在解决方案资源管理器中项目名称或依赖项节点的右键单击菜单中:
Once the option is enabled the Remove Unused References command will appear in the right-click menu of a project name or dependencies node in Solution Explorer:
“删除未用引用”命令Remove Unused References command
选择“删除未用引用”会打开一个对话框,你可以在其中查看要删除的所有引用,并能选择保留要保留的引用: