Skip to footer content
Iron Academy Logo
Learn C#
Learn C#

Other Categories

How to Set Up VS Code with C# Dev Kit on Linux

Tim Corey
19m 09s

Setting up VS Code for C# development on Linux takes about ten minutes, but the C# Dev Kit extension, hot reload configuration, and dev certificate behavior all need attention before you have a smooth workflow. Understanding each step upfront makes the process predictable.

In his video "VS Code with C# Dev Kit on Linux", Tim Corey walks through the full setup: downloading and installing VS Code, adding the C# Dev Kit extension, creating a Blazor web application, debugging it, and enabling hot reload. We'll cover each step along with the issues he runs into and how to work around them.

If you followed the previous episode on installing the .NET 10 SDK on Linux, this picks up right where that left off. By the end, you'll have a complete local development environment on Linux that covers everything a Windows setup would.

VS Code Is Not Visual Studio

[0:42 - 1:59] Tim starts with a clarification that trips up a lot of people: Visual Studio and Visual Studio Code are different products. Visual Studio is a full IDE that only runs on Windows because it's tied to Windows-specific libraries. VS Code is a lightweight, cross-platform text editor, and with the C# Dev Kit extension it becomes a capable environment for most .NET development work.

The distinction matters in practice because Visual Studio cannot be installed on Linux at all. VS Code is the path forward.

Installing VS Code

[1:59 - 3:46] The installation process is straightforward. Download the .deb file from the Visual Studio Code website, open it, and the package manager handles the rest.

Installing VS Code on Linux — downloading and running the .deb package

One useful side effect of this installation: it automatically adds Microsoft's package repository to apt, which means VS Code stays up to date through the normal system update process. Without this, you'd need to manually add the repository and its signing certificate.

Once installed, pin VS Code to the taskbar for easy access.

Adding the C# Dev Kit Extension

[4:44 - 5:47] Open the Extensions panel and search for "C#". The first result should be C# Dev Kit from Microsoft. As of the video recording, it has nearly 14 million downloads.

The extension is a significant upgrade over plain text editing for C# work.

Install it with auto-update enabled.

The Licensing Requirement

[5:47 - 8:03] After installation, the C# Dev Kit asks you to sign in with a Microsoft account for licensing. Microsoft's C# debugger is proprietary, which is why authentication is required before the full debugging experience is available.

The terms are permissive: free for individual developers, free for companies with fewer than five developers making under a million dollars a year, and only a paid Professional license is required beyond that threshold.

Creating a Blazor Web App

With VS Code configured, Tim creates a new project directly from the IDE. Using the "Create .NET Project" command, he selects the Blazor web app template and configures it with HTTPS, interactive auto mode, and sample pages included.

Creating a Blazor Web App project in VS Code on Linux

Once the project is scaffolded, the Solution Explorer appears on the left side, showing the project structure in a layout similar to Visual Studio.

Running and Debugging

To launch the app, use Run and Debug from the sidebar and select the HTTPS launch profile. VS Code builds the project and opens it in the default browser.

This is where Tim hits a known regression in .NET SDK 10.0.103: the dev certificates don't install correctly due to a merge conflict in the SDK build. The browser shows an untrusted certificate warning.

Running and debugging a Blazor app in VS Code on Linux — certificate warning and workaround

The workaround is to click through the browser warning ("Advanced" then "Continue"). The site runs fine over SSL once you do. Rolling back to SDK 10.0.102 or updating to 10.0.104 both resolve it permanently.

Despite the certificate hiccup, all default pages (home, counter, weather) load correctly.

Enabling Hot Reload

Out of the box, hot reload is disabled in VS Code. Tim demonstrates this by changing "Hello, World" to "Hello, YouTube" and seeing no update in the browser even after saving and refreshing.

Enabling it requires two settings in VS Code:

Enabling hot reload in VS Code C# Dev Kit and confirming live updates in the browser

With both settings enabled, restart the debug session. A fire icon appears in the toolbar, confirming hot reload is active. Saving a Razor file now immediately reflects the change in the browser.

What You Can and Can't Build on Linux

[16:59 - 18:00] Tim briefly explores the available project templates and makes an important observation: anything with "Windows" in the name (WinForms, WPF, UWP) won't be available because those frameworks are tied to the Windows platform.

What does work on Linux covers everything cross-platform in the .NET ecosystem: web applications, ASP.NET Core APIs, gRPC services, class libraries, console apps, test projects, and worker services.

For desktop applications on Linux, Uno Platform (using XAML and MVVM/MVUX) is mentioned as a future episode topic for building cross-platform desktop apps.

Wrapping Up: A Complete C# Environment on Linux

[18:02 - 18:28] By the end of the walkthrough, every piece of the development workflow is in place: editing, building, debugging, and live reloading all work from within VS Code on Linux. Opening an existing cross-platform .NET project from another machine should work without changes.

Conclusion

[18:02 - 19:07] To sum it up: VS Code with the C# Dev Kit gives Linux a complete C# development setup. The install is a downloaded .deb file and one extension. Hot reload is off by default but takes under a minute to enable from the settings panel. And the dev certificate issue in SDK 10.0.103 clears up in 10.0.104.

Most of the .NET project types you'd use in production (web apps, APIs, services, libraries) work identically on Linux. The ones that don't are explicitly designed around Windows-specific UI frameworks, which is the expected boundary.

So next time you set up a new Linux machine for development, the whole environment comes together in minutes. The only configuration that isn't obvious out of the box is hot reload, and now you know exactly where to find it.

Example Tip: If hot reload isn't working after enabling the settings, make sure you fully stopped and restarted the debug session. The fire icon in the debug toolbar confirms it's active. If the icon isn't there, the old session is still running without the new settings.

Watch full video on his YouTube Channel and gain more insights on developing C# on Linux.

Hero Worlddot related to How to Set Up VS Code with C# Dev Kit on Linux
Hero Affiliate related to How to Set Up VS Code with C# Dev Kit on Linux

Earn More by Sharing What You Love

Do you create content for developers working with .NET, C#, Java, Python, or Node.js? Turn your expertise into extra income!

Iron Support Team

We're online 24 hours, 5 days a week.
Chat
Email
Call Me