Visual Studio 2019 version 16.6 Preview 2 Brings New Features Your Way

Jacqueline

March 26th, 2020

Visual Studio 2019 version 16.6 Preview 2 comes with several new, exciting capabilities for you to try today. We recognize that everyone is facing unprecedented stress and concerns with current world events. The Visual Studio team are all working from home and learning how to navigate the challenges that brings to our day-to-day lives. Alas, even in these uncertain times, the team is extremely excited to bring you this latest update. Visual Studio 2019 version 16.6 Preview 2 comes with several new capabilities for you to try. Also, you have the opportunity to offer feedback in Developer Community. As you download and try these new features, we would like to extend our warmest wishes to your health and safety through the upcoming weeks.

Version Control

First of all, we are revamping our Git functionality to provide an improved experience when working with code on remote Git hosting services. You can begin working on code by browsing online GitHub or Azure repositories through Visual Studio and cloning them locally. For new projects, you can initialize the Git repository and push it to be hosted on GitHub with a single click. Once the code is loaded in Visual Studio, the new Git tool window consolidates all the Git operations having to do with your code.

Additionally, this feature streamlines the complex navigation for Git that used to live within Team Explorer. The new window minimizes context-switching between tools and applications by focusing on your daily developer workflows with actions like commit, pull, push, stash, and more. From the tool, you can quickly jump to workflows like the new branching experience. Last, there is also a new top-level Git menu to easily find all of your Git commands. This servers as a replacement of the old Teams menu. We continue to work hard to provide a first-class Git and GitHub experience in Visual Studio, and this is just the beginning.

If you would like to give this a try, toggle on the Preview Feature for New Git user experience in Tools > Options.

Improved Snapshot Debugging Experiences

Based on customer feedback, we wanted to minimize the friction involved in using Snapshot Debugger for the first time. You can now install Snapshot Debugger on Azure App Services (ASP.NET Core 3.1) without requiring a restart. This enables you to debug and diagnose live issues without interruption to your service! Attaching to Snapshot Debugger with Visual Studio Enterprise requires an install of the Snapshot Debugger site extension on your App Service deployment. This process previously required a restart.

New .NET Async Tool

Visual Studio 2019 version 16.6 Preview 2 has a new .NET Async tool as part of the Performance Profiler suite of tools. This adds ease to understanding and optimizing async/await code in .NET. Basically, you can use this tool to get exact timing information for a variety of tasks including how long they waited to be dispatched to a thread, how long it took to complete, and if the tasks were chained together.

New Multi-target JavaScript/TypeScript debugging and Service Worker Support

The JavaScript/TypeScript debugger now supports debugging service workers, web workers, iFrames, and your page JavaScript all at the same time! In addition, the new debugging experience adds support for debugging your back-end node server applications and client-side JavaScript in the browser simultaneously.

.NET Productivity

Almost always providing new updates, the .NET team has added an explicit cast when an expression cannot be implicitly cast. You can access this functionality by placing your cursor on the error and press Ctrl+. to trigger the Quick Actions and Refactorings menu. The option to Add explicit cast beomes available at that point.

Another feedback implementation coming into the product is the ability to automatically generate file headers to existing files, projects, and solutions by using an EditorConfig. If you’d like to give this a try, you can add the file_header_template rule to your EditorConfig file. Next, set the value to equal the header text you would like applied.

Once your cursor is on the first line of any C# or Visual Basic file, you can use Ctrl+. to trigger the Quick Actions and Refactorings menu where the option to Add file banner becomes available. From here you can apply the file header of an existing project or solution by clicking Fix all occurences in. We think this adds some great functionality. Do you?

Also in .NET, you can simplify conditional expressions by removing unnecessary code using the new Simplify conditional expression refactoring capability. Once again, Ctrl+. is the pathway to finding the menu option for Simplify conditional expression. Be sure to give this a try!

Additionally, from the same menu, a new option, Convert verbatim string allows you to convert regular string literals to verbatim string literals. The converse is also true where you can Convert to regular string from verbatim strings.

ML.NET Model Builder

ML.NET Model Builder is also included in this release of Visual Studio! You can enable Model Builder in Tools > Options > Environment > Preview Features.

Once it’s enabled, you can open Model Builder by right-clicking on your .NET project in Solution Explorer and selecting Add > Machine Learning:

What makes ML.NET Model Builder so exciting is you can easily build and consume custom machine learning models for text classification, value prediction, recommendation, and image classification in your .NET applications. All you need to do is select your machine learning scenario and choose your dataset. Model Builder will take care of training models, selecting the best model for your data, and generating the .NET code for consuming the model in your app. You can even scale out to the cloud and take advantage of Azure Machine Learning for image classification models without leaving Visual Studio or .NET.

New experience for configuring Azure services and emulators

The Connected Services tab now offers a new experience for connecting your application to Azure services such as Azure SQL, Storage, Key Vault and many others. It helps you provision new instances or select existing ones. Also, it ensures your code has the most update to date NuGet packages and the right startup configuration code. Wherever possible local emulation options are also available. If you decide to use Publish to deploy your application to Azure the same experience is available within the Profile Summary page minus the emulators.

Publishing now offers a new wizard-like experience for creating new publish profiles. This tool guides you through your various options. Even if some Visual Studio components are missing from your installation, you will still have access to the full set of publishing targets and options. Consequently, any of your missing components will be identified and requested to be installed on demand. The publish profile summary page has also been updated to match the new experience available under the Connected Services tab for configuring dependencies to Azure services as detailed above.

Additions to C++

We have added Ninja support for CMake for Linux/WSL. Now, you can use Ninja as the underlying generator when building CMake projects on WSL or a remote system. In addition, Ninja is now the default generator when you are adding a new Linux or WSL configuration. In addition, we have added simplified debugging templates for remote CMake debugging.

We have also improved Doxygen & XML comment generation support by adding the /** trigger sequence and enhancing member list tooltips.

On the same line of adding helpful support, our IntelliSense code linter now underlines code errors and suggests quick fixes in C++ projects. You can enable this tool under Tools > Options > Environment > Preview Features > IntelliSense code linter for C++.

The C++ team has put together blog posts on the Linter and XML commenter if you would like to know more.

In Summary

We have been working hard to keep bringing enhancements to the product. Also, we continue to address any issues brought up in Developer Community, so we invite you to participate with any issues or suggestions. Thank you for giving these features a try! If you’d like additional information on what we are working on next, check out the newly updated Visual Studio 2019 product roadmap. Meanwhile, we hope you and your loved ones stay healthy and safe.