Skip to content

Aspnet Installation

DodaTech 4 min read

title: ASP.NET Core Installation — Complete Guide to Setup and Tooling description: 'Learn installing ASP.NET Core: .NET SDK installation, CLI tools, Visual Studio/VS Code setup, create first project, project templates, and verifying your environment.' date: 2026-06-28 lastmod: 2026-06-28 weight: 12 tags: [backend, aspnet]


Installing ASP.NET Core requires the .NET SDK, which includes the runtime, CLI tools, and project templates for building web applications on Windows, Linux, or macOS.

## What You'll Learn

By the end of this tutorial, you'll install the .NET SDK, verify your setup with CLI commands, create your first ASP.NET Core project, and choose your development environment.

## Why Proper Installation Matters

A correct development environment saves hours of troubleshooting. Understanding SDK versions, runtime, and tooling ensures you can build, debug, and deploy ASP.NET Core apps.

## Real-World Use

A .NET team standardizes on .NET 8.0 SDK across 20 developers. CI/CD pipelines use the same SDK version. Consistent tooling eliminates environment-specific bugs.

## Installation Learning Path

```mermaid
flowchart LR
  A[Introduction] --> B[Installation]
  B --> C[Project Structure]
  C --> D[MVC]
  D --> E[Controllers]
  B --> F{You Are Here}
  style F fill:#f90,color:#fff

Installing .NET SDK

# Ubuntu/Debian
wget https://dot.net/v1/dotnet-install.sh
chmod +x dotnet-install.sh
./dotnet-install.sh --channel 8.0

# macOS (Homebrew)
brew install dotnet-sdk

# Windows (winget)
winget install Microsoft.DotNet.SDK.8

# Verify installation
dotnet --version
dotnet --list-sdks
Expected output:
8.0.403
8.0.403 [/usr/share/dotnet/sdk]

Creating Your First Project

# List available templates
dotnet new list

# Create web API project
dotnet new webapi -n MyFirstApi
cd MyFirstApi

# Create MVC project
dotnet new mvc -n MyFirstMvc

# Run the project
dotnet run
Expected output:
Building...
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.

Project Templates

# ASP.NET Core templates
dotnet new web          # Empty project
dotnet new webapi       # Web API with controllers
dotnet new api          # Minimal API
dotnet new mvc          # MVC with Razor views
dotnet new blazor       # Blazor Server
dotnet new blazorwasm   # Blazor WebAssembly
dotnet new angular      # Angular + ASP.NET Core
dotnet new react        # React + ASP.NET Core

Development Environments

# Visual Studio Code
code --install-extension ms-dotnettools.csharp
# Or use C# Dev Kit for better experience

# Visual Studio (Windows)
# Download from visualstudio.microsoft.com
# Select "ASP.NET and web development" workload

# JetBrains Rider
# Cross-platform .NET IDE with built-in support

Common Mistakes

1. Wrong SDK Version

Installing the runtime without the SDK. The SDK includes the runtime plus build tools (dotnet build, dotnet new).

2. Missing .NET Global Tools

Tools like dotnet-ef need explicit installation: dotnet tool install --global dotnet-ef.

3. Not Using the Correct TFM

Target Framework Moniker must match SDK version: net8.0 for .NET 8 SDK.

4. Forgetting to Restore Packages

First build on a new machine: dotnet restore downloads NuGet dependencies.

5. Development Certificate Issues

HTTPS requires a dev certificate: dotnet dev-certs https --trust on first run.

Practice Questions

1. How do I check the installed .NET SDK version?

Run dotnet --version or dotnet --list-sdks in the terminal.

2. What is the difference between SDK and Runtime?

SDK includes compilers and tools for building apps. Runtime only runs already-built apps.

3. How do I create a new ASP.NET Core Web API project?

dotnet new webapi -n ProjectName creates a new Web API project.

4. What is the default port for ASP.NET Core?

Port 5000 for HTTP and 5001 for HTTPS by default in development.

5. Challenge: Create and run a minimal API project with a custom endpoint.

dotnet new api -n MyMinimalApi
cd MyMinimalApi
# Edit Program.cs to add a custom endpoint

FAQ

Do I need Visual Studio for ASP.NET Core?

No. You can use VS Code, JetBrains Rider, or any text editor with the .NET CLI.

Can I install multiple .NET SDK versions?

Yes. They coexist. Use global.json to pin a specific version per project.

What is the .NET CLI?

The command-line interface for .NET development: create, build, test, publish, and run projects without an IDE.

How do I update the .NET SDK?

Run the installer for the new version, or use dotnet-install.sh script with --channel 8.0.

What is a global.json file?

Pins the .NET SDK version for a project: dotnet new globaljson --sdk-version 8.0.403.

Mini Project: Verify Your Setup

Create and run a complete ASP.NET Core project to verify your installation.

# Create project
dotnet new webapi -n SetupTest
cd SetupTest

# Add a custom endpoint in Program.cs
echo 'app.MapGet("/hello/{name}", (string name) => Results.Ok(new { Message = $"Hello, {name}!" }));' >> Program.cs

# Run and test
dotnet run &
curl http://localhost:5000/hello/ASP.NET

What's Next

ASP.NET Core Project Structure ASP.NET Core MVC

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro