From the blog: "What are other developers building with .net?". Introducing BuiltWithDot.Net

Getting started with cross platform asp.net core web development. Part 2: setup Visual Studio Code.

 

In the second part of this series you are going to take a closer look at Visual Studio Code and get it ready for building asp.net core apps by installing the C# language extension.

by Corstiaan Hesselink

Last updated: Tuesday June 26, 2018Reading time: 4 minutes

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:

  1. Visual Studio (Windows)
  2. Visual Studio for Mac (MacOS)
  3. JetBrains’s Rider (Windows/MacOS/Linux)
  4. 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:

  1. Click the extensions tab.
  2. Search for “c#” in the search bar.
  3. Click the “install” button on the extension information page.
  4. A “reload” button appears on the extension information page. Click it.

Visual Studio Code add C# language extension

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 project.json and .csproj files.

What’s next?

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.

Ready to dive into cross platform asp.net core?

Be the first to get notified when the next step is available. Delivered directly to your inbox, with my no-spam-guarantee™. Unsubscribe any time.