*** Updated as of March 2020 ***
There are tons of lists out there with the best Visual Studio Code extensions. Most are focused on general productivity or front-end development, with very few specific recommendations for .NET Core and C#. That’s why I decided to put this list together.
I’ve been using Visual Studio for more than a decade now. And while it’s gone through lots of changes, the core elements have pretty much stayed the same since 2010.
It became apparent when I started using VSCode that there were a few features missing to make the IDE feel familiar for a Visual Studio 2019 developer.
This list is targetted at developers moving from Visual Studio 2019, who want to make the transition a bit smoother. These extensions bridge the gap by addressing needs in the areas of debugging, keyboard shortcuts, testing, documentation, build options, and source countrol.
#1: C# for Visual Studio Code
The C# extension is the starting point if you want to write for .NET Core in Code. It brings with it many features that a Visual Studio developer will expect such as Intellisense, syntax highlighting, debugging, and more. Code automatically recommends it when you open a C# project, so all you need to do is click Install.
The only frequent problem I’ve had with it is randomly losing Intellisense, which requires a restart of the extension through the Command Palette via the
Omnisharp: Restart Service command.
#2: Visual Studio Keymap
Anyone who’s spent time learning keyboard shortcuts in Visual Studio will feel lost when starting out with VSCode. Visual Studio Keymap brings you as close as possible to the mappings from Visual Studio, with the exception of functionality that isn’t supported in VSCode.
#3: .NET Core Test Explorer
.NET Core is built around a powerful CLI. The
dotnet test command is highly configurable. Sometimes though, it’s nice to have a visual hierarchy of the tests. .NET Core Test Explorer does just that by adding a view that displays all the tests in the solution in a tree layout.
The extension doesn’t quite achieve feature parity with Test Explorer in Visual Studio, but it’s still worth adding to your toolkit.
#4: C# XML Documentation
The triple-forward-slash keyboard shortcut in Visual Studio, which adds a template for documenting the purpose of a method, doesn’t exist in VSCode unless you install this extension. This shortcut is a time saver that most .NET developers have adopted as the de-facto standard for writing method-level comments in Visual Studio.
A nice complement to this extension is Better Comments. It lets you format comments, warnings, TODOs, and more so that they are easily readable.
#5: .NET Core Tools
This handy extension makes it a lot quicker to build and run a .NET Core application by way of the context menu in the Explorer window.
Clicking either Build .NET Core Project or Run .NET Core Project opens an integrated terminal window that runs the selected command, making it easier to build or launch an application.
Bonus #1: NuGet Package Manager
There is a strong emphasis on using the editor and command line in Code. For long time Visual Studio users, this can be hard to get used to, especially when it comes to adding NuGet packages.
Luckily, this extension takes that burden away by providing an auto-complete for the name and version of any package you’re adding to the project.
Bonus #2: ILSpy .NET Decompiler
Ever wonder what a method is doing under the hood? Rather than load up a separate tool like ILSpy, DnSpy, or DotPeek to decompile the assembly, you can do it straight from Code by way of this extension.
Bonus #3: GitLens
This extension isn’t specifically for .NET Core but it helps to bring VSCode’s editor closer to the VS2017 experience. GitLens gives you the flexibility to see who and when source code was changed in-line within a file, much like in Visual Studio. The GitLens Explorer view provides much the same features as Team Explorer in VS2017, lowering the barrier to entry of the Git command line.
Once you’ve installed the extension, open the settings page by choosing GitLens: Open Settings from the Command Palette. There’s a few settings you’ll want to tweak to make it behave similarly to Visual Studio:
- Under Code Lens, uncheck Containers Scope
- Uncheck Current Line Blame
- Uncheck Hovers
- Uncheck Status Bar Blame
Bonus #4: WakaTime
The second bonus extension is on the productivity side of things. Ever wonder how much time you spend writing code per day, week, or month? Or which parts of a feature took longer to complete? WakaTime gives you the answers to those questions. It’s also useful to have a rough estimate of how much time you spent working on a given feature.
Did you find this post useful? If so, please consider retweeting it. If it helped you, it could help someone else too.
Thanks! I’ve switched to VSCode with this post near 1 year ago 🙂
I think you miss these two extensions.