The latest version on Visual Studio 2017 at this moment is still in Release Candidate (RC) stage on build 26127.03, released on 1st Feb 2017. There are many new features in this VS2017 which it is too long to write all of them down here. You may visit the release notes for more detail.
Here I want to highlight the new support for C# & VB, and also 2 new members in VS2017, Visual Studio for Mac and Visual Studio Mobile Center.
Visual Studio for the Mac
is built from the ground up for the Mac and focused on full-stack, client-to-cloud native mobile development, using Xamarin for Visual Studio, ASP.NET Core, and Azure. To learn more, please read Miguel de Icaza’s blog post introducing Visual Studio for Mac.
Visual Studio Mobile Center
is “mission control for mobile apps.” It brings together multiple services commonly used by mobile developers into a single, integrated service that allows you to build, test, deploy, and monitor cloud attached apps in one place. To learn more, please read Nat Friedman’s post elaborating on Visual Studio Mobile Center.
OK, let’s talk about the new feature support for C# & VB in VS2017.
IDE Experience and Productivity
Visual Studio provides new refactorings to allow you to organize source code with one action:
- New in RC Simplify object initialization with an initializer:
- New in RC Move
outvariable declarations inline, leveraging a new C#7 feature:
- New in RC Simplify null checks and throw expressions using null-coalescing operator, leveraging a new C#7 feature:
- Move type to matching file: Extract a type from one file and put it in another file with a matching name with one click via
- Sync file and type name: If your file and type name are out of sync, you can use
String.Formatto string interpolation: take advantage of the C# 6 language feature with this Quick Action.
This release also introduces improvements to IntelliSense that will make you more productive when working in a large solution or an unfamiliar codebase. We have added an icon tray to IntelliSense that enables you to filter the member list by type (e.g., methods, properties, classes, etc.). Each filter toggle has an associated keyboard shortcut which you can discover by hovering over the icon. To enable this feature, go to Tools > Options > Text Editor > [C# | Visual Basic] > IntelliSense and check the options for filtering and highlighting.
We’ve also added/updated style analyzers to help you customize and enforce coding conventions on your team, including:
- Naming style rules.
- Use of “var” or explicit types.
- Use of “this.” or “Me.” on member access.
- Missing braces.
- Missing switch case.
New in RC Building on Visual Studio’s support for EditorConfig, we worked with the community to add .NET code style settings to the file format. This means that you can configure your team’s code style conventions, check them into source control, and have violations appear live in the editor as developers are typing. You can see all the code style options in the Roslyn repo’s .editorconfig or in the documentation.
Other new features in this release include:
- You can now split a long string into multiple concatenated strings by positioning the cursor mid-string and pressing Enter.
- A new code action for converting a property to a method.
- We now use fuzzy matching in the NavigateTo search results.
Look for the following improvements to the IDE experience that are also in Visual Studio 2015 Updates:
- A new quick fix option to add a reference to a NuGet package.
- Refactorings that simplify delegate invocations and raising events using the null condition operator.
- Refactorings to make async methods synchronous where applicable.
- Improvements to Add Using command to support “fuzzy” matching for misspelled types, including adding any needed project or metadata references.
Language Extensions and Analyzers
This release includes some proposed new language extensions that we are working on for the next versions of C# and Visual Basic. These new language features are enabled by default and include:
- Task-like return types for async methods: This introduces the ability to return any task-like type from an async method. Previously these return types were constrained to
- Value tuples introduce language support for using tuples to temporarily group a set of typed values. To learn more, please review the design notes on GitHub.
- Nested local functions extend the language to support declaration of functions in a block scope.
- Pattern matching extensions enable many of the benefits of algebraic data types and pattern matching from functional languages.
- Ref returns enable functions to return values by reference.
For Visual Basic:
- Value tuples introduce language support for using tuples to temporarily group a set of typed values:
Dim point As (x As Integer, y As Integer) = GetOffset().
- ByRef return consumption extend the language to support consumption of functions and properties from libraries which have ByRef returns.
- Binary literals and digit group separators allow native representation of binary numbers. This is super convenient for bitmasks and flags enumerations:
For more information, follow our development on GitHub to learn more about these and other proposed language extensions and APIs.
Finally, we have done considerable work to improve responsiveness of the IDE in presence of background operations that compute diagnostics and CodeLens information.