Creating an Empty Project

Learn about building an ASP.NET Core project for displaying Northwind database suppliers.

We will start by creating an empty ASP.NET Core project and explore how to enable it to serve simple web pages.

A step-by-step guide for creating an empty project

We will create an ASP.NET Core project showing a list of suppliers from the Northwind database. The dotnet tool has many project templates that do a lot of work for us, but it can be difficult to know which works best for a given situation, so we will start with the empty website project template and then add features step by step so that we can understand all the pieces:

Step 1: Use your preferred code editor to open the PracticalApps solution or workspace and then add a new project, as defined in the following list:

  • Project template: ASP.NET Core Empty [C#]/web

  • Project file and folder: Northwind.Web

  • Workspace or solution file and folder: PracticalApps

  • For Visual Studio 2022, leave all other options as their defaults. For example, “Configure for HTTPS” was selected, “Enable Docker” cleared, and “Do not use top-level statements” cleared.

  • For Visual Studio Code and the dotnet new web command, the defaults are the options we want. We will not do this, but if we want to change from top-level statements to the old Program class style, specify the switch --use-program-main. In Visual Studio Code, select Northwind.Web as the active OmniSharp project.

Step 2: Build the Northwind.Web project.

Step 3: Open the Northwind.Web.csproj file and note that the project is like a class library except that the SDK is Microsoft.NET.Sdk.Web, as shown in the following markup:

Get hands-on with 1400+ tech skills courses.