On this page

What is .NET 10 and C# 14: ecosystem, CLR, and first project

12 min read TextCh. 1 — C# Fundamentals

What is .NET?

.NET is Microsoft's open-source, cross-platform, general-purpose development platform. With it you can build everything from console applications to web APIs, desktop apps, cloud services, mobile applications, and games.

.NET 10 is the LTS (Long Term Support) version released in November 2025. It provides three years of official support, making it the ideal choice for enterprise and long-running projects.

The .NET ecosystem in 2025

.NET 10 (unified platform)
├── ASP.NET Core 10   → Web APIs, MVC, Razor Pages, Blazor
├── EF Core 10        → ORM for relational databases
├── .NET MAUI         → Mobile and desktop applications
├── ML.NET            → Machine Learning
├── Orleans           → Distributed systems
└── Blazor            → Web apps with C# in the browser (WASM)

The platform runs on Windows, Linux, and macOS with first-class performance on all operating systems.

What is C#?

C# (pronounced "C sharp") is the primary language of the .NET ecosystem. It is a:

  • Strongly typed language — errors are caught at compile time
  • Object-oriented language — with classes, inheritance, and interfaces
  • Modern language — with functional features: LINQ, records, pattern matching
  • Safe language — automatic memory management via the Garbage Collector

C# 14 is the current version that ships with .NET 10. It includes improvements to generic type aliases, better type inference, and refinements to pattern matching.

The CLR: Common Language Runtime

The CLR (Common Language Runtime) is the .NET execution engine. When you compile C# code, you do not get native machine binaries directly; instead you get IL (Intermediate Language), architecture-independent bytecode.

C# source code (.cs)
        ↓ Compilation (csc / dotnet build)
   IL bytecode (.dll / .exe)
        ↓ Execution (CLR / JIT or AOT)
  Native machine code

The CLR provides:

Service Description
GC Garbage Collector — automatic memory management
JIT Just-In-Time compilation — IL to machine code at runtime
AOT Ahead-Of-Time compilation — native binaries without CLR in production
Type Safety Runtime type verification
Exception Handling Unified exception handling system
Thread Management Thread management and the Thread Pool

SDK vs Runtime

This distinction is fundamental when deploying applications:

SDK (Software Development Kit)

  • Includes the C# compiler (csc)
  • Includes the dotnet CLI
  • Includes the Runtime
  • Includes diagnostic tools
  • Required on your development machine

Runtime

  • Only includes the CLR and base libraries
  • Lighter (~25 MB vs 200+ MB for the SDK)
  • Sufficient to run already-compiled applications
  • What you install on production servers

Installing .NET 10

The easiest way is from the official site:

# On Linux (using the install script)
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --version 10.0.0

# On macOS with Homebrew
brew install --cask dotnet-sdk

# Verify the installation
dotnet --version
# output: 10.0.x

# List all installed SDKs
dotnet --list-sdks

# List all installed Runtimes
dotnet --list-runtimes

The dotnet CLI

The .NET CLI is your primary working tool. Here are the essential commands:

Command Description
dotnet new console Create a console application
dotnet new webapi Create a web API (ASP.NET Core)
dotnet new classlib Create a class library
dotnet run Compile and run
dotnet build Compile only
dotnet test Run tests
dotnet add package PackageName Add a NuGet package
dotnet publish -c Release Publish for production
dotnet watch run Hot reload during development

Your first console application

Let us create a console application that displays system information:

dotnet new console -n HelloWorld -f net10.0
cd HelloWorld

This generates a Program.cs file with minimal code. Modify it:

// Program.cs
using System.Runtime.InteropServices;

Console.Title = "My first .NET 10 app";
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("╔══════════════════════════════╗");
Console.WriteLine("║   Welcome to .NET 10 + C# 14  ║");
Console.WriteLine("╚══════════════════════════════╝");
Console.ResetColor();

// Environment information
Console.WriteLine($"\n.NET Version: {Environment.Version}");
Console.WriteLine($"Operating System: {RuntimeInformation.OSDescription}");
Console.WriteLine($"Processor: {RuntimeInformation.ProcessArchitecture}");
Console.WriteLine($"64-bit process? {Environment.Is64BitProcess}");

// Interactive input
Console.Write("\nEnter your name: ");
string name = Console.ReadLine() ?? "Unknown";
Console.WriteLine($"Hello, {name}! You are using .NET {Environment.Version.Major}.");

Run it with dotnet run and you will see the output in the console.

Structure of a .NET project

HelloWorld/
├── HelloWorld.csproj   ← Project file (XML)
├── Program.cs          ← Main source code
└── obj/                ← Temporary build files
    └── ...

The .csproj file is the heart of the project:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net10.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>
</Project>

Key properties:

  • Nullable>enable — activates nullability analysis (highly recommended!)
  • ImplicitUsings>enable — automatically imports System, System.Linq, etc.

NuGet: the package manager

NuGet is the npm equivalent for .NET. The official repository is nuget.org with over 300,000 packages.

# Add a package
dotnet add package Newtonsoft.Json --version 13.0.3

# Restore packages (after cloning a repo)
dotnet restore

# List installed packages
dotnet list package

Practice

  1. Install .NET 10 SDK on your machine and verify with dotnet --version.
  2. Create your first application with dotnet new console -n MyApp and modify Program.cs to display the current date with DateTime.Now.
  3. Explore the CLI: run dotnet new list to see all available templates and create one of type webapi.

In the next lesson we will explore the fundamental data types of C#: integers, decimals, strings, booleans, and how to use var, const, and nullable types.

SDK vs Runtime
The SDK includes the compiler, the Runtime, and CLI tools. The Runtime only includes what is needed to execute already-compiled applications. In production, install only the Runtime; in development, you need the full SDK.
.NET 10 is LTS
.NET 10 is an LTS (Long Term Support) version with 3 years of support. Always prefer LTS versions for production projects. Interim versions (11, 12…) have 18 months of support.
Top-level statements
Since C# 9, you do not need to write a Program class with a Main() method. You can write statements directly in Program.cs. The compiler generates the class and method automatically.
// Program.cs — .NET 10 / C# 14
// Top-level statements eliminate the Program class and Main method
using System;
using System.Runtime.InteropServices;

Console.WriteLine("Hello, .NET 10!");
Console.WriteLine($"Runtime version: {Environment.Version}");
Console.WriteLine($"OS: {RuntimeInformation.OSDescription}");
Console.WriteLine($"Architecture: {RuntimeInformation.OSArchitecture}");

// C# 14 type aliases with generics
using ProductId = int;
using ProductName = string;

ProductId   id   = 42;
ProductName name = "Laptop Pro";
Console.WriteLine($"Product #{id}: {name}");