⚙️ C# / .NET Intermediate

What is ASP.NET Core and how does it differ from ASP.NET Framework?

Answer

ASP.NET Core is a cross-platform, high-performance, open-source framework for building web APIs, web apps, and microservices, running on .NET Core/.NET 5+. Key differences from ASP.NET Framework: (1) Cross-platform: ASP.NET Core runs on Linux, macOS, Windows; Framework is Windows-only. (2) Performance: ASP.NET Core is significantly faster (top-10 in TechEmpower benchmarks). (3) Modular: opt-in middleware pipeline; Framework included many things by default. (4) Unified: MVC and Web API are merged in Core; separate in Framework. (5) Built-in DI: native dependency injection container. (6) Kestrel: built-in cross-platform web server (not IIS-dependent). (7) Configuration: flexible JSON/env/secrets-based; Framework used web.config. (8) No OWIN dependency: built-in pipeline. Use ASP.NET Core for all new development; ASP.NET Framework only for maintaining legacy Windows apps.