liveBook · Manning

Visual Studio Code

As explained in Pro ASP.NET Core 7, Tenth Edition

Visual Studio Code is Microsoft's cross-platform source-code editor with support for extensions and development workflows.

Visual Studio Code is a lightweight editor for ASP.NET Core development. It has fewer built-in project tools than Visual Studio, but can handle the same development work. If you are new to .NET, Visual Studio’s more structured file-creation tools may be easier to start with. section 2.1

Set up the editor and open a project:

  • Install the current stable Visual Studio Code build and select Add to PATH. Install the .NET SDK separately; the editor installer does not include it. For the .NET 7 setup, run `dotnet --list-sdks` in a new PowerShell window and check for a 7.0.1xx entry. section 2.1.3
  • Select File > Open Folder and open the project folder. Select `Program.cs` in Explorer, then accept any prompts to install the features or assets required for C# development. section 2.2.2

Add a static HTML file

Right-click the project folder in Explorer, choose New Folder, and name it `wwwroot`. Right-click that folder, choose New File, and name it `demo.html`. The extension matters: unlike a Visual Studio item template, this workflow leaves the file type to you. Add HTML content, such as `<h3>HTML File from MyProject</h3>` inside a page body. section 4.2

To run unit tests, open a test class and use the code lens action Run All Tests. Results appear as text in a terminal window. If the test actions are missing, close and reopen the Testing folder. section 6.3.2

How Pro ASP.NET Core 7, Tenth Edition covers it

How deep it goes
Walks through installation, project opening, file creation, and test execution, but does not examine editor internals.
Examples
Uses a `wwwroot/demo.html` file and code lens actions on a unit test class as concrete workflows.
What it assumes
Requires a separately installed .NET SDK and guides first-time installation of C# development features.
What you can do after
Practice/perform project setup, file creation, and unit-test execution in Visual Studio Code.
How it connects
Connects the editor to the .NET SDK, C# development features, ASP.NET Core static content, and unit tests.

Also explained in

Compare how 7 books explain Visual Studio Code →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Pro ASP.NET Core 7, Tenth Edition. The section links point to the parts of the book it draws on.