Page 28 - MSDN Magazine, September 2017
P. 28

• Go To All (Ctrl+T or Ctrl+,): Navigates directly to any file/ type/member/symbol declaration. You can use the icons along the top of the feature to filter your result list or use the query syntax (for example, “f searchTerm” for files, “t search- Term” for types and so on).
• Find All References (Shift+F12): Now with syntax coloriza- tion, Find All References results can be custom grouped by a combination of project, definition and path. You can also “lock” results so you can continue to find other references without losing your original results.
• Indent Guides: Dotted, gray, vertical lines act as landmarks in code to provide context within your frame of view. You may recognize these from the popular Productivity Power Tools.
Additionally, it’s not enough to be able to simply navigate your code base; we know that when you find places in your code to change or clean up, you need tools to help you with that refactoring. To assist with this, we’ve added support for moving a type to a file with same name, syncing a file and type name, adding a null-check for a parameter, adding a parameter, adding a missing switch/Select case, making a method synchronous, converting a method to property (and vice versa), and resolving a merge conflict—just to name a few.
Code Style In Visual Studio 2017, you can configure and enforce your team’s coding conventions to drive consistency across your entire repository with EditorConfig. EditorConfig is an open file format and we worked with its community to support .NET code style within this format. Teams can configure convention pref- erences and choose how they’re enforced inside the editor (as suggestions, warnings or errors). The rules apply to whatever files are in the directory that contains the EditorConfig file. If you have different conventions for different projects, you can define each project’s rules in different EditorConfig files as long as the projects are in separate directories. Because, at the end of the day,
EditorConfig is just a text file, so it’s easy to check it into source control and have it live and travel with your source. To learn more about EditorConfig support in Visual Studio, see aka.ms/editorconfig.
Live Unit Testing Once you have an MSTest or xUnit or NUnit test project, you can enable Live Unit Testing (LUT) for your .NET Core projects. LUT is a new feature introduced in Visual Studio 2017 Enterprise Edition. When you enable LUT, you get unit test coverage and pass/fail feedback, live in the code editor as you type, as shown in Figure 2. This means you no longer need to leave the editor to run unit tests to verify code changes. As soon as you type, you’ll see instant feedback in the editor that shows the results for all tests that are impacted by the code change.
Teams that are passionate about quality and users who love test-driven development (TDD) will love this new addition. To turn on LUT, navigate to the Test entry in the Visual Studio menu bar, and select Live Unit Testing | Start.
Visual Studio for Mac
Visual Studio for Mac is the newest member of the Visual Studio family for developers who want an IDE experience on the macOS. Visual Studio for Mac has evolved from Xamarin Studio, which brings support for C# and F# projects. To get started, first install the .NET Core 2.0 SDK (available to download from dot.net), choose Create Project, then select the App entry under the .NET Core category to choose your desired project template.
You’ll find you have a fully featured IDE for developing .NET Core apps on your Mac, as shown in Figure 3. One of the things we’re working hard at is to bring a consistent experience between Visual Studio and Visual Studio for Mac. At this point, you have most of the features you’ve come to rely on in Visual Studio, including Intel- liSense, code navigation, refactoring, unit testing and source control integration. For Web development, we’ve brought the Visual Studio
HTML, CSS and JSON editors to Visual Studio for Mac. You’ll notice that Razor files (.cshtml) and JavaScript/TypeScript are not currently supported, but we’re working to bring that support to Visual Studio for Mac in a future update.
Tools with the Modern
Cloud in Mind
As the world of technology evolves, one thing is clear—more and more apps are going to be designed to run in the cloud from the start. This means that your tools need to enable design pat- terns and practices with the modern cloud in mind, as well as enable you to quickly move an app from your local development machine to the cloud. With this goal in mind, both Visual Studio and Visual Studio for Mac have built-in support for publishing directly to Microsoft Azure, and for packaging applications as Docker containers.
.NET Core
Figure 2 Live Unit Testing Running on a .NET Core Project 24 msdn magazine


















































































   26   27   28   29   30