Visual Studio Toolbox
21 New Tools and Extensions for Visual Studio 2017
From legacy xBase code to cutting-edge Quantum computing, these Visual Studio extensions will make you more productive.
- By Terrence Dorsey
Microsoft is hard at work on Visual Studio 2019, but developers are still rolling out increasingly helpful and sophisticated tools and extensions for Visual Studio 2017. You can always make your development environment better, or at least tweaked to better accommodate your preferences, to make mundane tasks simpler, to learn new languages or to generate code automatically for old ones. You can even find templates to set up projects just the way you want them and extensions to track how much time you spend working on each file in a solution. Here's my latest round-up of tools you should be checking out.
Testing is a crucial step in the development process, but I know there are many coders out there who struggle with not only which testing methodology to use, but also the holistic thought process of writing correct and useful tests. Thankfully there are many tools and frameworks to make the process easier.
SmartTests.Extension, by Ludovic Dubois, is a fantastic Visual Studio 2017 extension for anyone who feels they need a little help writing testable code and unit tests. Smart Tests provides a library and Visual Studio Analyzer focused on Test-Driven Development (TDD). The excellent documentation provides straightforward examples of well-written tests to get you started, and walks you through the process of setting up Smart Tests in your project to run the tests. You'll get feedback on missing tests via a built-in Visual Studio Analyzer. You can use Smart Tests on C#-based projects using the NUnit, xUnit or MSTest unit testing tools.
NCrunch is an automated parallel continuous testing tool for Visual Studio. NCrunch runs your tests for you and displays analysis results -- including code coverage, performance metrics and inline exception details -- within the Visual Studio IDE. NCrunch also optimizes your tests with support for parallel execution on multi-core systems (with the ability to control how much it uses) and prioritizes tests for your most recently changed code. You get support for C#, F#, and Visual Basic code along with testing tools including NUnit, xUnit, MSTest, MbUnit, MSpec, and SpecFlow. Extensive documentation on the NCrunch Web site. A 30-day free trial is available.
For those of you using xUnit.net, there are some great extensions being released by the community. xUnit for Devices Project Templates, by Oren Novotny, provides test templates for Xamarin iOS, Xamarin Android and UWP device codebases.
xUnit.net.TestGenerator, by Yowko Tsai, uses the built-in Visual Studio unit test generator to create xUnit 2.0 tests.
j.sakamoto's xUnit Code Snippets is a bit of a misnomer. It's not so much code snippets, but more simple text expansions in Visual Studio for automating the creation of xUnit Fact methods, Theory methods and test classes, with support for async methods. Still very useful and worth checking out. I love a good text expansion.
The NUnit 2 and NUnit 3 Test Adapters, along with the SwitchToNUnit3 utility and NUnit Test Generator extension, continue to be developed and updated for Visual Studio 2017. These continue to be great test adapers. However, since Microsoft is considering VSIX test adapters deprecation for Visual Studio 16 (2019), the NUnit team recommends updating your projects to use the NUnit3TestAdapter NuGet package. This has been a public service announcement.
ResXManager - Visual Studio Marketplace is community-driven open source project overseen by Tom Englert that provides a fantastic utility for managing all the ResX string resources in your solution. You can browse through all of your resource files, displaying the resource keys and strings in an easy-to-navigate grid view. This is really handy whether you're editing the primary string resources or managing localized resources.
ResXManager runs as both a Visual Studio extension and a stand-alone application, so you can even have localizers working on the code outside of Visual Studio. The extension also includes a customizable resource code generator. Both versions include automated translation, orphan resource detection, string import and export, resource snapshots for change tracking and review (often needed with outside translators), multi-language spellchecking, and the ability to automate tasks with PowerShell scripts.
Jamie Cansdale's Temporary Projects extension helps keep the clutter on your dev machine to a minimum by letting you create ad hoc, temporary project folders that default to the current date, rather than the generally unhelpful \ClassLibrary76. You can, of course, edit the name and location before creating the project. This makes it much easier to go back, clean up and organize those temporary projects later if you have some context for when and why they were created.
With Microsoft acquiring GitHub, it's likely we'll see further improvements around Git/GitHub integration in future iterations of Visual Studio. In the meantime, check out TGit, an extension by Samir Boulema to control TortoiseGit, the Windows Shell Interface to Git, from within Visual Studio. TGit gives you some simple keyboard shortcuts for over 15 common Git tasks including changing branches, pulling, committing, pushing and more. I personally love command-line Git and like seeing extensions like this that bring the workflow into the IDE in a simple, easy-to-remember manner.
OpenFileByName, by Jeffrey Broome, makes is easy to find and open a file in the current solution without taking your fingers off the keyboard. Simply type the name of the file (or part of it) and open the file. Simple and effective.
When you're working with complicated solutions and want to maintain different, useful views of your files, Multiple Solution Explorer Tools, by Michal Žůrek, will help. The extension makes scoped or customized Solution Explorer views persistent across Visual Studio sessions. In Solution Explorer, right-click a folder that you want to set as the root folder of new view, then select the New Solution Explore View option in the context menu. The selected Solution Explorer view is created in a new window. If the view is open when you close Visual Studio, it will re-open next time you start Visual Studio and re-open that solution.
David Anderson's Project Explorer extension gives you a fully configurable Project Explorer window that lets you find, organize and display project folders in the manner that makes sense for you. Project Explorer lets you specify which file types you want displayed, along with a token-delimited path hints that tell Project Explorer where to look for project files and directories as well as how to display them.
More New Extensions
If you're curious about what it takes to write software for quantum computers and Microsoft's Scalable Quantum computing resources, download the Microsoft Quantum Development Kit preview and then dig into the Writing a Quantum Program Q# language tutorial. Q# is a domain-specific programming language used for writing the quantum algorithms that will run in Microsoft's Quantum environment, which is sort of Azure for quantum computing. It's all pretty new stuff, and now is the time to start learning about this new frontier.
Speaking of new languages, XSharp (X#) is a .NET Framework-based language implementation using xBase syntax. Designed for ongoing support of legacy systems, XSharp provides a compiler, runtime and Visual Studio integration based on Roslyn. Using familiar Visual Studio 2017 tools you can write xBase-dialect code including VO/Vulcan, FoxPro, dBase, Xbase++ and Harbour.
React Core Boilerplate, by Nikolay Maev, provides a configured template environment for React-based Web applications. Designed for Web professionals who want all of their frameworks and tools configured for launching new projects quickly and efficiently, React Core Boilerplate includes TypeScript, React Router and React Helmet, Redux, SASS CSS preprocessing, WebPack, Axios, Serilog, and more.
On the subject of Web development, Max Meng's TypeSharp is a handy utility for converting C# model classes into TypeScript. It's a simple implementation at this time, but open source and configurable with custom grammars.
Entity Framework Visual Editor, by Michael Sawczyn, gives you an interface for visual modeling, review and documentation of persistent Entity Framework classes including inheritance and unidirectional and bidirectional associations. The editor also generates sophisticated, consistent and correct Entity Framework code that can be regenerated when your model changes. You can edit or even replace T4 templates for customized code generation, add coloration to simplify model viewing, show and hide parts of the model, and more. There's also teriffic documentation.
XPath Tools, by Uli Weltersbach, adds XPath query features directly to Visual Studio, helping you navigate complicated XML documents and namespaces, including showing your current XPath right in the status bar.
For C++ developers, Clang Power Tools brings the power of Clang/LLVM tools like clang-tidy, clang-analyzer and clang-format to Visual Studio. Clang Power Tools helps you perform code transformations and optimizations, find latent bugs with static analysis and CppCoreGuidelines checks and more. The checks and analysis tools are highly configurable, and results include extensive and useful tips for understanding what you're trying to fix and how it helps your application.
Finally, ever wonder how productive you really are? Or, more specifically, where you're spending the most time in your development project? Kurt G. Nielsen's DevTracker-Time Summary gives you a summary of time spent working in a solution down to the code file, and includes statistics including the current session, day view for today, yesterday, or up to seven days back, week view, month view, and totals for the entire solutions life span. Reports include list views or pie views. Controls include starting, pausing, and stopping time tracking, along with configurable options for tracking idle time.