How to Start a New .NET Project in 2026: A Beginner's Friendly Guide
A warm, step-by-step guide to starting a new .NET 10 project in 2026 with the dotnet CLI, the right template, and good folder habits from day one.
Imagine you are about to cook a new dish for the first time. Before you light the stove, you do a few small things. You pick a clean shelf to work on. You lay out your bowls, your spoon, and your spices in a neat row. You read the recipe once so you know the order of steps. None of this is the cooking itself, but it makes the cooking calm and pleasant instead of messy and stressful.
Starting a new software project is the same idea. Before you write the clever parts, you set up a clean, tidy space. You pick the right tools. You make a folder. You choose a starting template. When this groundwork is done well, the rest of the work feels smooth. When it is skipped, you spend the next month tripping over your own mess.
This guide walks you through starting a fresh .NET 10 project in 2026, step by careful step. We will go slowly. By the end you will be able to create a project from a clean terminal, understand each file you see, and set up good habits that bigger teams use every day.
Why .NET 10 in 2026
.NET is a free, open-source platform from Microsoft for building all kinds of software: web services, desktop apps, mobile apps, and small command-line tools. It runs on Windows, Linux, and macOS.
In 2026, the version you should pick for most new work is .NET 10. It is an LTS release, which stands for Long Term Support. LTS means Microsoft promises to support it with security fixes and bug fixes for three years, until November 2028. For a beginner, LTS is the kindest choice because the ground under your feet stays stable.
The language you will write in is C# 14, which ships together with .NET 10. You do not have to turn it on. When you target .NET 10, C# 14 is already enabled. There is also a newer wave coming: C# 15 with union types is being previewed in early .NET 11 builds. You do not need that yet. Stick with the stable LTS road for now.
The big picture
Steps
Idea
Decide what you want to build.
Install SDK
Get the dotnet command.
Create project
Use a template.
Run it
See it work.
Improve it
Add your own code.
Step 1: Install the .NET SDK
The SDK (Software Development Kit) is the toolbox that lets you create, build, and run .NET programs. The most important thing it gives you is the dotnet command in your terminal. That one command does almost everything.
You can download the .NET 10 SDK from the official .NET website. Pick the installer for your operating system and run it like any normal program. After it finishes, open a fresh terminal and check that it worked.
// This is a terminal command, not C# code.
// It asks the SDK to print its version number.
dotnet --versionIf you see something like 10.0.100, you are ready. If the terminal says it does not know the dotnet command, close it, open a new one, and try again. A fresh terminal picks up the new tool.
You do not need Visual Studio to begin. Many people start with VS Code, which is free, plus the C# Dev Kit extension. Visual Studio 2026 is also a fine choice if you prefer a full editor. The SDK alone, though, is enough to do every step below.
Step 2: Pick a place to work
Before creating anything, make a clean folder. This is your shelf. Keeping each project in its own folder stops files from getting mixed up.
// Terminal commands to make and enter a new folder.
mkdir HelloDotnet
cd HelloDotnetNow you are standing inside an empty folder, ready to create your project. This may feel like a tiny step, but a tidy starting folder saves you real confusion later.
Step 3: Choose the right template
A template is a ready-made starting point. Instead of writing every file by hand, you ask the SDK to generate a working skeleton for you. The command is dotnet new followed by the template name.
There are many templates. Here are the ones a beginner meets most often.
| Template name | What it makes | Good for |
|---|---|---|
console | A tiny program that prints to the screen | Learning C#, small tools |
webapi | A minimal API web service | Backends, APIs, learning the web |
classlib | A library of reusable code, no UI | Shared code used by other projects |
blazor | An interactive web UI app | Web pages with C# instead of JavaScript |
mstest | A test project | Writing automated tests |
To see the full list any time, run dotnet new list. It prints every template your SDK knows about.
Let us start with the simplest one, the console app, so you can see the whole shape of a project clearly.
// Create a console project in the current folder.
dotnet new consoleIn .NET 10 this gives you a very small Program.cs file. Open it and you will see something close to this.
// Program.cs - the entry point of a console app.
Console.WriteLine("Hello, World!");That single line is a complete program. When you run it, the computer prints Hello, World! and stops. Notice there is no big ceremony around it. Modern C# lets you write the program directly, and the compiler fills in the rest behind the scenes.
Step 4: Run your project
Now light the stove. Ask the SDK to build and run your program.
// Build and run the project in the current folder.
dotnet runYou should see Hello, World! appear in the terminal. That is your first .NET 10 program running. Take a breath and enjoy it. Everything bigger you ever build starts from exactly this moment.
The diagram below shows what happened when you typed that command.
When you run for the first time, the SDK quietly does three jobs. It restores any libraries your project needs, it compiles your C# into a form the computer can run, and then it runs the result. On later runs, if nothing changed, it skips the slow parts and starts faster.
Step 5: Understand the files you got
Open the folder and look at what the template created. For a console app it is short.
| File or folder | What it is |
|---|---|
Program.cs | Your actual C# code, the starting point |
HelloDotnet.csproj | The project file that describes settings |
obj/ | Temporary build files, safe to ignore |
bin/ | The compiled output, also safe to ignore |
The most interesting one is the .csproj file. It is small but important. It tells the SDK which .NET version you target and which extra libraries you depend on. Here is a typical one for .NET 10.
// HelloDotnet.csproj - the project settings file.
// (This is XML, shown here for reading only.)
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>Two settings here are worth knowing as a beginner. Nullable set to enable asks the compiler to warn you when a value might be empty, which catches a whole family of bugs early. ImplicitUsings set to enable means common using lines are added for you, so your files stay short and clean.
Step 6: Try the web API template
Most real .NET work in 2026 is web services, so let us make one too. Go back up a folder and create a fresh project.
// Create a web API project in its own folder.
dotnet new webapi -n MyFirstApi
cd MyFirstApi
dotnet runIn .NET 10, dotnet new webapi gives you a minimal API. Minimal APIs let you describe a web endpoint in just a line or two. The template also wires up OpenAPI support, which is the document that describes your API to other tools.
Here is the heart of a minimal API. You can read it almost like English.
// Program.cs for a minimal web API.
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
// When someone visits /hello, reply with a greeting.
app.MapGet("/hello", () => "Hello from .NET 10!");
app.Run();The line app.MapGet("/hello", ...) says: when a browser asks for the path /hello, run this small function and send back its result. Start the app, open http://localhost:5000/hello in a browser, and you will see the greeting. You just built a working web service.
If you want a path that includes a value, like asking for one item by its id, you write the route with a placeholder. In prose we write that route as GET /{id}, and in code it looks like this.
// A route with a value in the path.
app.MapGet("/items/{id}", (int id) => $"You asked for item {id}");The diagram below shows the journey of a single web request through your new API.
Step 7: Group projects with a solution
So far you made single projects. As your app grows, you often have several projects that belong together: one for the web API, one for shared code, one for tests. A solution is a container that groups them so you can manage them as one set.
// Create a solution and add a project to it.
dotnet new sln -n MyApp
dotnet sln add MyFirstApi/MyFirstApi.csprojThink of a solution like a lunchbox. Each project is a separate small box inside it. The lunchbox keeps them together and easy to carry. The picture below shows a common, tidy layout for a growing app.
Notice the arrows. The API and the tests both use the Core library, but Core does not depend on them. Keeping your shared, important code in the middle, with everything pointing toward it, keeps a project healthy as it grows.
Step 8: Set up good habits from day one
A few small habits, added at the very start, save hours later. They are easy to add now and annoying to add after a mess has formed.
Healthy starting habits
Steps
Git
Track every change.
gitignore
Skip bin and obj folders.
Format
Keep code style consistent.
README
Explain how to run it.
First, turn on Git so every change is saved and you can go back if you break something. Then add the standard ignore file so build junk is not saved.
// Start version control and add the .NET ignore file.
git init
dotnet new gitignoreSecond, keep a steady code style. The command dotnet format tidies spacing and layout so your files always look the same. Third, write a short README that says, in plain words, what the project is and how to run it. Future you will be grateful.
A word about big libraries
When you read blogs, you will see famous library names like MediatR and MassTransit. They are powerful, but here is an honest note for 2026: their newer versions moved to a commercial license. That means a company may now have to pay to use them in production. For a brand new learning project, you almost never need them.
The kind advice is simple. Start with plain C# classes and the tools built into .NET. Add a big library only when you clearly feel the problem it solves. A young project that stays small and clear is far easier to learn from than one stuffed with heavy tools you do not yet understand.
Putting it all together
Here is the whole journey in one view, from an empty terminal to a tidy, running project with good habits in place.
Each box is a small step you have now seen. None of them is hard on its own. Done in order, they turn a blank screen into a real project you understand from top to bottom.
Quick recap
- Pick .NET 10 for new work in 2026 because it is the LTS version, supported until November 2028, and it brings C# 14 automatically.
- You only need the .NET SDK to start. It gives you the
dotnetcommand. An editor like VS Code or Visual Studio 2026 is a nice extra, not a must. - Always create a clean folder first, then use
dotnet newwith a template. Useconsoleto learn the language andwebapifor a minimal API web service. - Run your project with
dotnet run. The first run will restore, compile, and then run your code. - Read the small
.csprojfile. TheTargetFramework,Nullable, andImplicitUsingssettings matter most for beginners. - Group related projects with a solution using
dotnet new sln, and keep your shared code in a central library that others depend on. - Add good habits early:
git init,dotnet new gitignore,dotnet format, and a shortREADME. - Skip heavy libraries like MediatR and MassTransit at first. They are now commercially licensed, and a young project rarely needs them.
References and further reading
- dotnet new command (Microsoft Learn)
- Default templates for dotnet new (Microsoft Learn)
- What's new in .NET 10 (Microsoft Learn)
- What's new in C# 14 (Microsoft Learn)
- Tutorial: Create a Minimal API with ASP.NET Core (Microsoft Learn)
- Announcing .NET 10 (.NET Blog)
Related Posts
6 Steps for Setting Up a New .NET Project the Right Way
A friendly, step-by-step guide to starting a clean .NET 10 project with the right folder layout, central packages, analyzers, EditorConfig, and CI.
How to Build a URL Shortener With .NET: A Beginner's Step-by-Step Guide
A friendly, step-by-step guide to building a URL shortener in .NET 10 using minimal APIs and EF Core. Learn short codes, redirects, and storage.
Top 10 Things Every .NET Developer Needs to Do in 2026
A warm, beginner-friendly checklist of the 10 most useful habits and skills every .NET developer should pick up in 2026, with .NET 10 and C# 14.
Exploring C# File-Based Apps in .NET 10: Run a Single .cs File
Learn how C# file-based apps in .NET 10 let you run a single .cs file with dotnet run, add packages with directives, and grow into a full project.
How to Create Command-Line Console Applications in .NET
A beginner-friendly guide to building command-line console apps in .NET 10 with the dotnet CLI, arguments, options, and System.CommandLine.
The New .slnx Solution Format: A Simple Migration Guide for .NET 10
Learn the new XML-based .slnx solution format in .NET 10, why it beats the old .sln file, and how to migrate safely with one CLI command.