ASP.NET Core Setup - Create Your First Project
Level: Beginner
Use this page to prepare your machine and run your first ASP.NET Core app. Do not skip setup, because every later article assumes you can create, run, stop, and modify a local project.
- Install the .NET SDK
- Check whether .NET is installed correctly
- Choose Visual Studio or VS Code
- Create your first ASP.NET Core project
- Understand the first project files
- Run the app on localhost
- Modify routes and test them in the browser
- Fix common beginner setup issues
What You Need
You need two things:
| Tool | Why You Need It |
|---|---|
| .NET SDK | Creates, builds, and runs .NET/ASP.NET Core projects |
| Code editor | Lets you write and edit C# code |
The SDK is different from the runtime.
| Term | Meaning |
|---|---|
| SDK | Developer tools: create, build, run projects |
| Runtime | Only runs already-built apps |
For learning, install the SDK, not only the runtime.
Step 1: Install .NET SDK
Windows
- Go to dotnet.microsoft.com/download
- Download the latest LTS SDK. In 2026, that is .NET 10 LTS.
- Run the installer.
- Finish installation and restart your terminal.
Verify in PowerShell:
dotnet --version
You should see a version such as:
10.0.x
If your class or company uses .NET 8, that is also okay. The fundamentals are the same.
macOS
Use the installer from Microsoft or Homebrew:
brew install dotnet
dotnet --version
Linux
Package names differ by distro. On Ubuntu/Debian style systems:
sudo apt-get update
sudo apt-get install -y dotnet-sdk-10.0
dotnet --version
If your package source does not provide .NET 10 yet, install the latest LTS SDK available for your operating system.
Step 2: Choose an Editor
Option A: Visual Studio
Best for beginners on Windows.
Install workload:
ASP.NET and web development
Good for:
- Debugging
- IntelliSense
- Project templates
- Beginners who prefer buttons and UI
Option B: Visual Studio Code
Lightweight and fast.
Install extensions:
- C# Dev Kit
- C#
- .NET Install Tool
Good for:
- Smaller machines
- Terminal-based learning
- Cross-platform development
Step 3: Create Your First Project
Open terminal and run:
dotnet new web -n SchoolPortal
cd SchoolPortal
Meaning:
| Command | Meaning |
|---|---|
dotnet new web | Create a minimal ASP.NET Core web project |
-n SchoolPortal | Project/folder name |
cd SchoolPortal | Move into the project folder |
Project Files
After creating the project:
SchoolPortal/
+-- Program.cs <- Where the app starts
+-- appsettings.json <- App settings
+-- SchoolPortal.csproj <- Project file
+-- Properties/
+-- launchSettings.json
What Each File Means
| File | Beginner Meaning |
|---|---|
Program.cs | Main startup file for the web app |
appsettings.json | Stores configuration such as logging and connection strings |
.csproj file | Tells .NET project name, target framework, and packages |
launchSettings.json | Local run settings like ports and browser launch behavior |
Do not memorize everything now. Just know where the app starts: Program.cs.
Step 4: Run the App
Run:
dotnet run
You may see:
Now listening on: http://localhost:5000
or:
Now listening on: https://localhost:7001
Open the URL shown in your terminal.
If the app says Hello World!, your setup works.
What is localhost?
localhost means this computer.
When you open:
http://localhost:5000
you are not visiting an internet website. You are calling the ASP.NET Core app running on your own machine.
What is a port?
A port is like a door number.
localhost:5000
means:
Computer: this machine
Door: 5000
If another app already uses port 5000, ASP.NET Core may choose another port or show an error.
Step 5: Modify Program.cs
Open Program.cs.
Replace the default route with this:
Test these URLs:
| URL | Expected Output |
|---|---|
/ | Welcome to School Management System |
/students | All students will be shown here |
/students/101 | Student details for id: 101 |
/teachers/5 | Teacher details for id: 5 |
Now you have started building the School Management System backend.
Stop the App
In terminal:
Ctrl + C
This stops the local web server.
Common Setup Problems
| Problem | Why It Happens | Fix |
|---|---|---|
dotnet is not recognized | SDK not installed or terminal not restarted | Install SDK, close terminal, open again |
| Browser says site cannot be reached | App is not running | Run dotnet run |
| Address already in use | Another app is using same port | Stop that app or use another port |
| Changes not showing | App did not reload | Stop with Ctrl+C and run again |
| Wrong folder | Command is run outside project | Run cd SchoolPortal |
| HTTPS warning | Local development certificate | Trust dev certificate or use HTTP for now |
Useful Commands
| Command | Use |
|---|---|
dotnet --version | Check installed SDK |
dotnet --info | Show detailed .NET info |
dotnet new web -n SchoolPortal | Create minimal web app |
dotnet run | Run app |
dotnet build | Compile app without running |
dotnet watch run | Run with auto-reload |
Beginner Checklist
- [OK] Installed .NET SDK
- [OK] Chose editor
- [OK] Created
SchoolPortal - [OK] Ran the app locally
- [OK] Opened localhost URL
- [OK] Modified
Program.cs - [OK] Tested routes in browser
Do not delete the SchoolPortal folder. In the next articles, you will use the same idea to understand Program.cs, request pipeline, middleware, routing, dependency injection, and controllers.
Q: How do you create and run an ASP.NET Core project?
Good Answer: "I install the .NET SDK, then use dotnet new web -n ProjectName to create a minimal ASP.NET Core project. I move into the folder with cd ProjectName and run it using dotnet run. The app starts a local server, usually on localhost with a port. I can then open that URL in the browser and test routes defined in Program.cs."
Practice Before Next Article
- Create a new project named
SchoolPortal. - Add routes for
/students,/teachers, and/fees. - Run the app and test all routes.
- Stop the app using
Ctrl + C. - Explain what
localhostmeans.
Use ChatGPT, Claude, or Copilot to go deeper on ASP.NET Core setup. Try these prompts:
"Why do I need the .NET SDK instead of only runtime?""Explain localhost and port in simple words""Give me 5 practice routes for a School Management System""What should I do if dotnet command is not recognized?"
💡 Tip: After reading this article, paste your own code into AI and ask "What could go wrong here and why?" — fastest way to find edge cases and deepen understanding.
ASP.NET Core Section Links
Use these links to continue the full Backend > ASP.NET Core Fundamentals topic from the top menu:
- ASP.NET Core Fundamentals
- ASP.NET Core Web API
- Entity Framework Core
- SQL Server Tutorial
- .NET Developer Roadmap
- Final Project
- ASP.NET Core Interview Questions
Target search terms for this lesson: asp.net core setup, create asp.net core project, dotnet new webapi, visual studio asp.net core setup.