C# Dev Kit Extension for VS Code
Do you like VS Code for code editing? Do you recognize that feeling that VS Code is just not for you because it is not convenient enough working with your C# project? You are just like me! I really like VS Code for editing tons of file types, but just not my C# projects because VS Code lacks that last bit of convenience working in a solution. The C# Dev Kit may change your take on this, it did change mine...

So you like C# and you like VS Code? Sure, I do as well.. But I am very picky at when I switch to VS Code. I really like the Visual Studio (Proper) IDE for my C# development, as it has the sophisticated Solution Explorer and AI powered help in the background that make me more productive and happy over all as a developer.

Today, this game changed. There is now a VS Code extension called the C# Dev Kit. This extension can be installed in VS Code and brings a lot of tools available in VS Proper, to VS Code. So what’s new? Well, not so much… A lot of the tooling was already available in VS Proper, simply not in VS Code. This extension brings those tools to VS Code which is (at least to me) a huge thing.

Licensing information

Before I continue this post, I’m going to have to inform you that, to use this extension, there is some licensing involved. I do not exactly know how it works and what tool will be available in what license, but just be advised there is licensing involved. I have seen a lot of negative messages around this.

I still can’t believe Microsoft keeps putting C# Development behind a paywall

-Someone on the internet

I think we live in a world where we are spoiled with free products. Always remember, nothing is free. If you don’t have to pay, you are the product. I never heard someone complaining about the licensing fee of ReSharper or any other productivity tool. Some productivity tools simply cost money. Having said that, let’s go and dig in…

Installation

Installing the extension is as easy as clicking the Extensions button on the left toolbar in VS Code and search for ‘C# Dev Kit’. In fact, this kit is a bundle containing a couple of tools that integrate in your VS Code. Once installed, you may receive an update message that once of the tools needs to be updated immediately, which is kind of weird, but hey.. Let’s update it.

What has changed

After you have installed the extension, you may see that (if you start an empty instance of VS Code) the Explorer is decorated with an extra button the create a new C# project. When you click it, a dropdown appears showing you all project templates installed on your local machine. Once you clicked one of the templates, your project will be created, similar like in VS Proper.

Solution Explorer

Start Unit Tests right where you write them On the left of your screen, when you have the explorer open, you may have noticed that a new Tab is now available, the Solution Explorer. This Solution Explorer provides the exact same view as the Solution Explorer in VS Proper. The Solution being the top level of your tree view, and all projects it contains underneath.

Breakpoints FTW

You can add breakpoints in your code and run your code from VS Code using the play button in the lower left corner. Once the execution path of your code hits the breakpoint, the extension will stop execution of your code, allowing you to debug your code and view runtime information.

Testing experience

Start Unit Tests right where you write them The testing experience is really amazing. You can now go and create unit tests, which will appear in the Test Explorer that comes with the extension. When you view the code of your test, you’ll see a play button in the bar right next to your test. This button allows you to run the test from right there. You can go and run, or debug the test if you like, or navigate to the test explorer if you like.

Conclusion

So again, this post covers some productivity tools in VS Code for C# that have been in VS Proper for ages. Yet still, I think the VS Code IDE is fast, lean and a delight to work with. For me however, this was primarily for Typescript, Bicep, YAML pipelines and those kinds of workloads, not necessarily C# projects simply because I missed those basic tools that come with Visual Studio. Now they are also available in VS Code, I think I don’t have to switch IDE as much and can work more and more in the same IDE.


Last modified on 2023-06-07

Hi, my name is Eduard Keilholz. I'm a Microsoft developer working at 4DotNet in The Netherlands. I like to speak at conferences about all and nothing, mostly Azure (or other cloud) related topics.