.NET Core and Web Development

Building modern web apps with .NET

Posted by Rodrigo Castro on January 12, 2025

.NET Core (now .NET 5/6+) is a cross-platform, high-performance framework for web development.

🏗️ ASP.NET Core Web Apps

  • MVC: Model-View-Controller, for full-featured web apps.
  • Razor Pages: Page-centric, lightweight alternative.
  • Web API: RESTful APIs for SPA/mobile clients.

🚀 Create a Web App

1
2
3
dotnet new mvc -n MyWebApp
cd MyWebApp
dotnet run

Visit https://localhost:5001 in your browser.

🛠️ Project Structure

  • Controllers/ – business logic and endpoints
  • Views/ – HTML templates (Razor)
  • Models/ – Data objects

🔑 Middleware

  • Add features like authentication, logging, error handling.
  • Configure in Startup.cs with app.UseXyz().

🌍 Hosting

  • Deploy to IIS, Azure, Linux, Docker, etc.

Next: Structuring projects with .NET Core!