What is the difference between ASP.NET MVC and ASP.NET Core?
Quick Answer
ASP.NET MVC 5 runs only on the Windows .NET Framework, is hosted in IIS through System.Web, and needs third-party libraries for dependency injection. ASP.NET Core is cross-platform, self-hosted through Kestrel, has DI, configuration and logging built in, uses a middleware pipeline instead of HTTP modules and handlers, and merges MVC and Web API into one framework.
The programming model is the same — controllers, actions, Razor views, model binding — so if you know MVC 5 you can read ASP.NET Core code straight away. What changed is the foundation. MVC 5 only runs on the Windows .NET Framework and is welded to IIS and System.Web. ASP.NET Core is cross-platform, hosts itself with Kestrel, and has dependency injection, configuration and logging built into the framework instead of bolted on. The old HTTP modules and handlers are replaced by a middleware pipeline you compose in code, and Web API is no longer a separate stack. The net effect is that Core apps are faster, smaller to deploy and testable by default.
Both use the Model-View-Controller pattern, controllers, actions and Razor views, so day-to-day code looks similar. The differences are in the platform and the plumbing:
- Runtime — MVC 5 targets .NET Framework (Windows only). Core targets .NET (Windows, Linux, macOS, containers).
- Hosting — MVC 5 is tied to IIS and
System.Web.dll. Core runs in-process or out-of-process behind Kestrel and can sit behind IIS, Nginx or nothing. - Dependency injection — MVC 5 has no container; you add Autofac, Unity or Ninject. Core ships one and uses it internally.
- Request handling — MVC 5 uses
Global.asax, HTTP modules and handlers. Core uses ordered middleware configured inProgram.cs. - Configuration — MVC 5 uses
web.config/ConfigurationManager. Core uses layered providers bound toIOptions<T>. - Web API — separate framework (
ApiController) in MVC 5; the sameControllerand routing in Core. - Performance — Core is markedly faster and uses less memory.