Why Should I Extend Visual Studio?
by Rishabh Verma
Visual Studio (VS) is the most popular choice of developers working on the Microsoft technology stack. It is an integrated development environment (IDE) and makes the development as well as debugging easy. While there has been rise in the code editors like Visual Studio Code, Visual Studio IDE still holds its ground. The Google trends from the web search over last one year reveals the same as shown in Figure 1.1
Figure 1.1: Interest over last 1 year
Visual Studio 2019 is the latest and greatest version available at the time of writing this post. Like most Microsoft products, the great thing about Visual Studio is that it is highly extensible and customizable. An obvious question comes to mind.
Why should I extend Visual Studio?
I have heard this question many times. So, why are we here? Visual Studio is a great IDE and makes the developer very productive in coding, development, debugging and troubleshooting. Then why do I even bother about extending it? Well, there are numerous reasons to do so. A few of the top ones are:
1. Visual Studio's customization allows you to form it to suit your needs and environment.
2. To avoid a repetitive or tedious work. With extensions, it can be done just by a click of a button.
3. To do things faster. It can increase your productivity. It can be in the form of a snippet, or code analysis, or code refactoring, or a project/item template, or anything else that can get the developer job done faster. There are numerous extensions which can make even the extension development faster!
4. Higher quality development. There are few great examples of extensions like Roslyn analyzers, StyleCop, FxCop, CodeMaid, and Resharper to name a few. This avoids unnecessary bugs in the future and the code can be compliant to coding standards, resulting in better quality.
5. Helps to enforce policies or settings across the teams. There are extensions that can help you get the code consistency and uniformity even across a large team. For example, a check-in policy extension can ensure that each code check-in has work item associated to it and has 0 StyleCop and FxCop violations. Without this, the code would not check-in.
6. Career growth. You can either contribute to the community by sharing your great extension on marketplace for free, or monetize it and charge a fee from consumers to use it. You can grow your name and can also make some money if you can create great extensions.
7. "It would be cool if…." Mads Kristensen is one of the most popular extension writers in the Visual Studio marketplace with 127+ extensions to his credit. In one of his talks on Visual Studio extensibility, he explained how he thinks about a new Visual Studio extension and framed it beautifully. "It would be cool if…"
8. There are numerous great extensions for Visual Studio for improving developer productivity, quality, refactoring, editors and controls available in the Visual Studio marketplace https://marketplace.visualstudio.com/. As of today, there are more than 10.3K extensions in marketplace with more than 30 million downloads and counting.
We know that Visual Studio can be extended and the reasons to extend it. However, how to extend Visual Studio remains a puzzle for most software developers.
To demystify this problem, my new book is your guide. The book starts from ground zero with an introduction to the basic concepts of Visual Studio including data structures and design patterns and moves forward with the fundamentals of the VS extensibility model. Then it gets you started in this journey by helping you install the required tools and prerequisites to get started. Then, you will learn how the Visual Studio discovers and loads an extension. Next, you will go through the extensibility model and see how various extensions, such as menus, commands, and tool windows, can be plugged into VS. Moving forward, you’ll cover developing VS extensions and configuring them, along with demonstrations on customizing extension by developing option pages. Further, you will learn to create custom code snippets. Next, you will go through creation of project and item templates including deployment of VS extensions using continuous integration (CI). Finally, you will learn tips and tricks for Visual Studio and its extensibility. After reading Visual Studio Extensibility Development you will be able to develop, deploy, and customize extensions in Visual Studio IDE.
About the Author
Rishabh Verma is a Microsoft certified professional and works at Microsoft as a senior development consultant, helping the customers to design, develop, and deploy enterprise-level applications. An electronic engineer by education, he has 12+ years of hardcore development experience on the .NET technology stack. He is passionate about creating tools, Visual Studio extensions, and utilities to increase developer productivity. His interests are .NET Compiler Platform (Roslyn), Visual Studio extensibility, code generation and .NET Core. He is a member of .NET foundation (https://www.dotnetfoundation.org). He occasionally blogs at https://rishabhverma.net/. He has authored books on .NET Core 2.0 and .NET Core 3.1 prior to this title.His twitter id is @VermaRishabh and his linkedIn page is https://www.linkedin.com/in/rishabhverma/
This article was contributed by Rishabh Verma, author of Visual Studio Extensibility Development.