You might be wondering what is the “best” editor to get started building cross platform asp.net core apps.
By the end of this article you’ll have a clear sense of the editors that are available, why Visual Studio Code is a good place to start and how to configure it with some additional extensions.
Where Visual Studio Code fits in
When it comes to editors and IDEs in asp.net core you have roughly four choices:
- Visual Studio (Windows)
- Visual Studio for Mac (MacOS)
- JetBrains’s Rider (Windows/MacOS/Linux)
- Visual Studio Code (Windows/MacOS/Linux)
In this series you’ll be focusing on number 4: Visual Studio Code. Why?
- Because it’s the lightest of the bunch.
- Because it does not bother you too much with .net related tooling which in the beginning can be a bit daunting and distracting. You’ll be using the command line for interacting with our project (like adding packages, etc) and don’t need a full fledged IDE at this point. Note that you can always “upgrade” to Visual Studio at a later time.
- Because it runs on Windows, MacOS and Linux. This series is about cross platform asp.net core web development after all.
- It’s open-source and free, unlike some of the others.
In part 1 we already installed Visual Studio Code and took a quick look at the main differences between Visual Studio and Visual Studio Code, despite their similar names.
And with these formalities out the way, let’s get started.
Turning Visual Studio Code into a mini asp.net core IDE
Visual Studio Code is essentially a generic code editor that can be augmented with plugins to add functionality.
First, you need to add the C# language extension. Open Visual Studio Code and do the following:
- Click the extensions tab.
- Search for “c#” in the search bar.
- Click the “install” button on the extension information page.
- A “reload” button appears on the extension information page. Click it.
Why do you need this extension? Well, out of the box Visual Studio Code doesn’t know what to do with C# code. This extension provides C# editing support, including syntax highlighting and IntelliSense (.net’s name for “code completion”) among other. It also adds debugging support of .net core apps which ties in with the runtime and sdk you installed in part 1. You’ll need this bit further down the road. The extension also enables basic support for working with .net core project files like
In the next article you’ll create your first asp.net core web app and run it straight from Visual Studio Code, as well as from the command line. And you’ll be taking a look at the basic file structure of an asp.net core app. Be sure to sign up below for updates.