Visual Studio 2019 v16.8 Preview 2 Releases New Features Today!
New features in Git Integration, .NET Productivity, Web Tools, and Xamarin are releasing in Visual Studio 2019 v16.8 Preview 2. Each of our teams continue to work hard to delight our developers. For this reason, Preview releases are some of the most exciting for us as we wait to hear how our newest features impact your work.
From my perspective, one of the greatest aspects of shipping releases is how engaged you are in the improvement of our products. If you have any suggestions or run into any challenges using these features, please visit our Developer Community to let us hear your perspective. If you want greater details of what’s in this release, please see our release notes.
New Features in this Release
Some repositories have more than one solution in them. Now when you open such a repository, the Solution Explorer will display a list of solutions for you to select. By default, folder view is always present at the top. This opens the root folder of the repository. Double clicking on a solution in this list will take you to that solution. Also, you can use the Switch Views button in the Solution Explorer toolbar to take you back to the list of views to easily move between solutions in your repository.
In the case you have only one solution in your repository, Visual Studio will load solution view by default. On the other hand, if you have no solutions in your repository, Visual Studio will open folder view by default. You can toggle this feature on/off using its own Preview Feature checkbox in Tools | Options.
The new Git experiences are also coming to your Live Share experience. Now you can view the contents of the Git windows in read-only mode when you are a Guest in a Live Share session.
We’ve been listening to the feedback on the Git Repository window and have been making incremental tweaks. Also in this release, is the ability to single click to switch between branch histories while browsing through branches in your repo.
There are now C# and Visual Basic support for inline parameter name hints that insert adornments for literals, casted literals, and object instantiations prior to each argument in function calls. In order to access this feature, you will need to turn this option on in Tools > Options > Text Editor > C# or Basic > Advanced and select Display inline parameter name hints (experimental). The inline parameter name hints will then appear in C# or Visual Basic file.
In addition, you can now extract members from a selected class to a new base class with the new Extract Base Class refactoring. To give this a try, place your cursor on either the class name or a highlighted member. Press (Ctrl+.) to trigger the Quick Actions and Refactorings menu. From there, select Pull member(s) up to new base class. The new Extract Base Class dialog will open where you can specify the name for the base class and the location of where it should be placed. You can select the members you want to transfer to the new base class and choose to make the members abstract by selecting the checkbox in the Make abstract column.
Once you select Ok you will see the new base class added along with its members.
Another feature is a code fix to convert instances of typeof in C# and GetType in Visual Basic. Using nameof instead of the name of the type avoids the reflections involved when retrieving an object. As shown below, place your cursor within the typeof(<QualifiedType>).Name. Press (Ctrl+.) to trigger the Quick Actions and Refactorings menu. Next, select from one of the following options:
For C#, select Convert `typeof` to `nameof`:
For Visual Basic, select Convert `GetType` to `NameOf`:
WPF, UWP, and Xamarin.Forms Tooling
In this release we’ve worked to make additional improvements to XAML Hot Reload experiences, changes include:
Also, in this release we begin to rollout support for a highly requested feature. Forms “changes only” XAML Hot Reload now supports UWP. This enables the new changes only XAML Hot Reload support in Xamarin.Forms Projects when targeting UWP. Please note this feature is still in development. While editing XAML will now trigger updates in the running app, other features such as in-app toolbar (element selection, etc.) are not yet fully implemented and can have unpredictable behavior.
As part of a bigger effort that will be completed across multiple 16.8 Preview release comes XAML Hot Reload Settings moved to “Debugging > Hot Reload”. We’re starting to consolidate the XAML Hot Reload settings across WPF, UWP and eventually Xamarin.Forms into a unified settings location. In this release we’ve started this process by moving the existing desktop settings out of the Debugging > General > Enable UI Debugging Tools for XAML and into a new location under Debugging > Hot Reload. No settings will be changed during this migration so all your existing choices will continue to stay in effect. Also, for the first time ever we’re enabling the ability to disable/enable XAML Hot Reload support per-platform, meaning you can disable these experiences for WPF, UWP or both.
Give Visual Studio 2019 v16.8 a Try Today!
We hope you are as excited about these features as our teams. We are also continually working towards more product stability and performance improvements. Please let us know how we are doing, and we hope you have a productive day using Visual Studio 2019.