Top 5 .NET Core Extensions for Visual Studio Code

Posted by

There are tons of lists out there for the best Visual Studio Code extensions. Most are focused on general productivity or front-end development, with very few recommendations for .NET Core and C# specifically. 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 VS2010.

It became apparent when I started using VSCode for a side project that there were a few key features missing to make the IDE feel familiar for a VS2017 developer.

So this list will be especially useful for developers migrating from Visual Studio 2017 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 VSCode. It brings with it many features that a Visual Studio developer will expect such as Intellisense, syntax highlighting, debugging, and more.

The extension is technically still in beta but is fairly stable nonetheless. 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 and mastering 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 no exception to this with its configuration parameters. Sometimes though, it’s nice to have a visual hierarchy of the tests. .NET Core Test Explorer does just that by adding a view to Explorer that displays all the tests in the solution in a tree or flat layout.

The extension still needs some work to achieve parity with Test Explorer, but it’s definitely worth adding to your extension toolkit.

#4: C# XML Documentation

The triple-forward-slash keyboard shortcut in Visual Studio, which adds a template for documenting 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 a de-facto standard for writing method comments in Visual Studio.

An interesting complement to this extension is the Better Comments extension. It doesn’t support the triple-forward-slash shortcut but does provide colour highlighting options for warnings and TODOs.

#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 will open an integrated terminal window that runs the selected command, making it much faster to build or launch an application.

Bonus #1: 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

There are many more settings that can be tweaked to your preference as well.

Bonus #2: 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.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s