Skip to content

Creating New Projects

Create new .NET projects from templates directly within VS Code.

C# Dev Tools provides full integration with the .NET CLI template system, allowing you to create new projects without leaving VS Code.

There are several ways to create a new project:

  1. Right-click on a solution or solution folder
  2. Select Add > New Project
  3. The project creation wizard will open
  1. Press Ctrl+Shift+P
  2. Type “C# Solution Explorer: Create New Project”
  3. Select the command

The wizard guides you through the project creation process:

Browse and search through available project templates:

  • Console Application - Command-line applications
  • Class Library - Reusable code libraries
  • ASP.NET Core Web App - Web applications with Razor Pages
  • ASP.NET Core Web API - RESTful API services
  • Blazor Server App - Server-side Blazor applications
  • Blazor WebAssembly App - Client-side Blazor applications
  • WPF Application - Windows desktop applications
  • Windows Forms Application - Windows desktop applications
  • xUnit Test Project - xUnit test projects
  • NUnit Test Project - NUnit test projects
  • MSTest Test Project - MSTest test projects
  • And many more…

Use the search box to quickly find templates by name or technology.

Provide the project configuration:

  • Project Name: The name of your new project
  • Location: Where to create the project (defaults to solution directory)
  • Solution Folder: Optionally place the project in a solution folder
  • Target Framework: Choose the .NET version (e.g., .NET 8.0, .NET 6.0)

Some templates provide additional options:

Web Projects:

  • Authentication type (None, Individual, Windows)
  • HTTPS configuration
  • Docker support

Class Libraries:

  • Target framework
  • Package options

Test Projects:

  • Enable code coverage
  • Additional test frameworks

Click Create Project to generate the project:

  1. The .NET CLI will execute the template
  2. The project will be created in the specified location
  3. The project will be added to the solution
  4. The Solution Explorer will refresh to show the new project

Once the project is created:

  • The project appears in the Solution Explorer
  • The solution file is updated with the new project reference
  • You can immediately start editing files in the project
  • Required NuGet packages (if any) are automatically restored

The extension supports any .NET templates installed on your system:

Terminal window
dotnet new install <template-package-name>

For example:

Terminal window
dotnet new install Microsoft.AspNetCore.SpaTemplates

Custom templates will appear in the template selection list.

To see all available templates:

Terminal window
dotnet new list

If a template doesn’t appear:

  1. Ensure the .NET SDK is installed and in your PATH
  2. Run dotnet new list in a terminal to verify the template is installed
  3. Restart VS Code after installing new templates

If project creation fails:

  1. Check the Output panel for error messages
  2. Verify you have write permissions in the target directory
  3. Ensure the project name is valid (no special characters)
  4. Check that the .NET SDK version supports the selected template

If the project was created but not added to the solution:

  1. Right-click the solution in Solution Explorer
  2. Select Add > Existing Project
  3. Navigate to and select the .csproj file