Welcome to .NET — A Beginner Friendly Introduction

This page explains .NET using simple language so anyone—even total beginners—can understand what it is and how to start creating apps.

🌱 What Is .NET (In Plain English)?

.NET is a free set of tools that helps you build applications. Think of it like a toolbox + engine combined:

You can use .NET to build websites, desktop apps, mobile apps, games (Unity uses C#), and even small automation tools.

🚀 Your First Program (C#)

This tiny program prints text on your screen:

Console.WriteLine("Hello, beginner!");

Save it as Program.cs and run it using:

dotnet new console -n FirstApp
cd FirstApp
dotnet run

🟣 Visual Basic Example

Here's the same beginner program written in Visual Basic (VB):

Module Program
    Sub Main()
        Console.WriteLine("Hello from Visual Basic!")
    End Sub
End Module

Create a VB project:

dotnet new console -lang vb -n HelloVB
cd HelloVB
dotnet run

🌐 ASP.NET Core — Build Your First Website

This makes a simple web server that says "Hello World" when you visit a link.

dotnet new web -n MyWebsite
cd MyWebsite
dotnet run

Now open your browser at: http://localhost:5000

📱 MAUI — Build Your First Mobile/Desktop App

MAUI lets you create apps for Windows, Android, macOS, and iOS.

Create a project:

dotnet new maui -n MyMauiApp

A simple UI example:

<VerticalStackLayout>
  <Label Text="Hello, world!" />
  <Button Text="Click Me" />
</VerticalStackLayout>

🐳 Deploying with Docker (Beginner Version)

Docker lets you "package" your .NET app so it runs the same everywhere.

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY . .
RUN dotnet publish -c Release -o /app

FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
COPY --from=build /app .
ENTRYPOINT ["dotnet", "MyApp.dll"]
Run it:
docker build -t myapp .
docker run -p 8080:8080 myapp

🔄 CI/CD with GitHub Actions (Simple Version)

This runs your tests automatically when you push code to GitHub:

name: .NET CI
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-dotnet@v3
      with:
        dotnet-version: '8.0.x'
    - run: dotnet restore
    - run: dotnet build --configuration Release
    - run: dotnet test

🖼️ Visual Illustrations & Simple Diagrams

How .NET Works (Simple Diagram)


   +-------------------------+
   |       Your Code         |
   |  (C#, VB, F#, etc.)     |
   +-----------+-------------+
               |
               v
   +-------------------------+
   |     .NET Runtime        |
   |  (runs & manages code)  |
   +-----------+-------------+
               |
               v
   +-------------------------+
   |   Operating System      |
   | (Windows/Mac/Linux)     |
   +-------------------------+

Website Flow (ASP.NET Core)


User → Browser → ASP.NET App → Response Back to User

🎯 Interactive Beginner Challenges

Try editing these examples directly in your browser console!

Challenge 1 — Print Your Own Message

Rewrite this to print your own name:

Console.WriteLine("Hello WORLD!")

Challenge 2 — Fix the Mistake

Function AddNumbers(a As Integer, b As Integer) As Integer
    Return a +  ' something is missing!
End Function

Goal: Make it return a + b.

Challenge 3 — Write a Loop

Make it print numbers 1 to 5.

For i As Integer = 1 To 5
    ' your code here
Next

🧩 Step-by-Step Beginner Projects

1️⃣ Console Calculator (Beginner)

Console.Write("Enter first number: ")
Dim a As Integer = Integer.Parse(Console.ReadLine())
Console.Write("Enter second number: ")
Dim b As Integer = Integer.Parse(Console.ReadLine())
Console.WriteLine($"Result: {a + b}")

2️⃣ To‑Do List (Beginner)

Dim todos As New List(Of String)()
todos.Add("Learn .NET")
todos.Add("Build my first app")
For Each item As String In todos
    Console.WriteLine("• " & item)
Next

3️⃣ Web API (ASP.NET Core) — Super Simple

var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

app.MapGet("/hello", () => "Hello from your API!");

app.Run();

Run it → then open http://localhost:5000/hello

Loops (Beginner)

' Print numbers 1..5
For i As Integer = 1 To 5
    Console.WriteLine(i)
Next

Classes (Create a simple Person)

Public Class Person
    Public Property Name As String
    Public Property Age As Integer
    Public Sub SayHi()
        Console.WriteLine($"Hi, I'm {Name} ({Age})")
    End Sub
End Class
' Usage
Dim p As New Person With {
    .Name = "Alex",
    .Age = 28
}
p.SayHi()

Async (Simulated)

Public Async Function DelayHello() As Task
    Await Task.Delay(1000)
    Console.WriteLine("Hello after 1 second")
End Function

LINQ (Simple)

Dim numbers = {1, 2, 3, 4, 5}
Dim evens = numbers.Where(Function(n) n Mod 2 = 0).ToList()
' evens = {2, 4}