A sample Blazor Server application built with .NET 10 demonstrating modern web development with C# and Blazor.
Blazor is a framework for building interactive web UIs using C# instead of JavaScript. With Blazor Server, your app runs on the server, and UI updates are sent to the browser over a SignalR connection.
Benefits:
- β Write full-stack web apps in C#
- β Share code between client and server
- β Rich .NET ecosystem and tooling
- β Real-time updates via SignalR
- β No JavaScript required (though you can use it)
- .NET 10 SDK
- JetBrains Rider (optional, but recommended)
- Or Visual Studio 2025 / VS Code
git clone https://github.com/WolfBot2026/blazor-server-sample.git
cd blazor-server-sampledotnet restoredotnet runThe app will start at:
- HTTP: http://localhost:5000
- HTTPS: https://localhost:5001
Navigate to: https://localhost:5001
You should see the Blazor app with:
- Home page
- Counter page (interactive example)
- Weather forecast page (data example)
blazor-server-sample/
βββ Components/ # Blazor components
β βββ Layout/ # Layout components (MainLayout, NavMenu)
β βββ Pages/ # Page components (Home, Counter, Weather)
β βββ App.razor # Root component
βββ wwwroot/ # Static files (CSS, JS, images)
βββ Properties/ # Launch settings
βββ appsettings.json # App configuration
βββ Program.cs # App entry point
Blazor uses reusable components with .razor files that combine HTML and C#.
See Counter.razor for button click event handling:
<button @onclick="IncrementCount">Click me</button>Two-way data binding example in forms and inputs.
Client-side routing with @page directive:
@page "/counter"Services are injected into components:
@inject WeatherForecastService ForecastServicedotnet builddotnet watch runChanges to .razor files will automatically reload in the browser!
dotnet testdotnet publish -c Release -o ./publish- Azure App Service: Easy deploy with built-in support
- Docker: Create a Dockerfile and containerize
- IIS: Publish and host on Windows Server
- Linux: Use Kestrel with reverse proxy (nginx, Apache)
- Blazor Documentation
- Blazor Tutorial
- Awesome Blazor - Curated resources
Want to extend this app? Try:
- Add a form - Create a contact form with validation
- Use a database - Connect to SQL Server or SQLite
- Add authentication - Implement user login with Identity
- Create an API - Add RESTful endpoints
- Use Tailwind CSS - Modernize the UI styling
- Add real-time features - Use SignalR for chat or notifications
- Progressive Web App (PWA) - Make it installable
If ports 5000/5001 are taken, edit Properties/launchSettings.json to use different ports.
Trust the development certificate:
dotnet dev-certs https --trustMake sure you're using dotnet watch run and the SDK supports hot reload (10.0+).
- Created: 2026-01-29
- Framework: .NET 10.0
- Template: Blazor Web App (Server interactivity)
- IDE: JetBrains Rider 2025.3.1
MIT License - See LICENSE file for details.
Built by WolfBot πΊ β’ Demonstrating the power of Blazor Server with .NET 10!