305

What exactly is the difference between .NET Core and ASP.NET Core?

Are they mutually exclusive? I heard ASP.NET Core is built on .NET Core, but it can also be built on the full .NET framework.

So what exactly is ASP.NET Core?

1

5 Answers 5

316

Update 2020: Do note that ASP.NET Core 3 and higher now depend on .NET Core and can no longer be used on .NET Framework. The below description is for ASP.NET Core 1.x-2.x; the layer separation still holds true for ASP.NET Core 3.0 but the ASP.NET Core layer can no longer be used on top of .NET Framework in 3.0+.

.NET Core is a runtime. It can execute applications that are built for it.

ASP.NET Core is a collection of libraries that form a Framework for building web applications. ASP.NET Core libraries can be used on both .NET Core and the "Full .NET Framework" (which has shipped with windows for many years).

The confusing part is that an application using the libraries and tools of ASP.NET Core is usually referred to as "ASP.NET Core Application", which in theory doesn't say if it is built for .NET Core or .NET Framework. So an "ASP.NET Core Application" is also a ".NET Core Application" or a ".NET Framework Application".

This image shows the relation of the involved technologies (taken from this blog post) .NET Web Application Technologies

Here you can see that ASP.NET Core is built "on top of" both .NET Framework and .NET Core, while "ASP.NET" (now often referred to as "classic ASP.NET") is .NET Framework only.

7
  • 39
    So what do we call classic ASP? "Ancient ASP"? :pCommentedJul 23, 2017 at 15:45
  • 7
    @DanSchnau, we have "Classic ASP", "ASP.NET" AKA "Classic ASP.NET" and "ASP.NET Core", so no conflict at all :)CommentedMar 6, 2019 at 12:44
  • @MartinUllrich: Is it true that we can't deploy the .net on cloud but .net Core can be deployed on cloud?CommentedJan 26, 2020 at 13:16
  • Depends on what "cloud" means to you. E.g. Azure AppService can host classic .NET Framework web applications built 10 years ago. Creating linux-based docker images for use in cloud-hosted kubernetes will require .NET Core.CommentedJan 26, 2020 at 14:56
  • but a worker service is directly .net core and not ASP net core right ? I am often confused about can i have a worker service application on asp net core instead of .net core?
    – kuldeep
    CommentedJun 28, 2020 at 7:16
74

ASP.NET Core using .NET Core - all dependencies are self-contained, can use most NuGet packages, can't use Windows-specific packages, can execute on Windows, Linux, and Mac.

ASP.NET Core using .NET Framework - most dependencies are self-contained, only executes on Windows, will have access to Windows-specific NuGet packages, needs the .NET framework version which is targeted installed on the machine.

3
  • 107
    Who names these things? This is super confusing.
    – Nick
    CommentedFeb 14, 2020 at 15:54
  • 7
    @Nick: Microsoft marketing. They have a long history of this. They haven't discovered the web yet - using common nouns for products (not good in a search engine world where more specific less common words are better, preferably unique words not in the dictionary).CommentedFeb 26, 2020 at 21:46
  • 4
    A little outdated but related: Note that .NET 5.0 is the subsequent version of .NET Core 3.1 rather than .NET Framework 4.0 "to avoid confusion"[learn.microsoft.com/en-us/dotnet/core/dotnet-five]
    – Beltway
    CommentedFeb 3, 2021 at 9:32
48

ASP.NET Core is one of the workloads supported by .NET Core.

From .NET Core guide:

By itself, .NET Core includes a single application model -- console apps -- which is useful for tools, local services and text-based games. Additional application models have been built on top of .NET Core to extend its functionality, such as:

  • ASP.NET Core
  • Windows 10 Universal Windows Platform (UWP)
  • Xamarin.Forms
1
  • 5
    This is a more relevant answer for me. .Net Core for console app, ASP.Net Core for web app.CommentedJan 11, 2020 at 3:47
19

.NET Core is the next evolution of the .NET Framework, that allows Microsoft technology to be hosted on other OS platforms, rather than Windows.

ASP.NET is the web framework provided by Microsoft for building:

  • server-side rendered web pages/websites
  • server-side components for SPAs
  • MVC-fashion apps
  • web services/web APIs/microservices

ASP.NET runs only on Windows platforms.

Since .NET Core was created to provide the capability of running Microsoft tech on top of Linux/macOS, it implies that ASP.NET Core is the evolution of ASP.NET in the direction of multi-platform support.

In conclusion:

ASP.NET Core runs on both .NET Core and .NET 5.0, on top of multiple OS platforms: Windows, Linux & macOS.

ASP.NET 4.x (ASP.NET/ASP.NET MVC) runs on the .NET Framework only, on top of Windows OS.

enter image description here

    17

    The .NET Framework is on its last release. There will not be another one after 4.8. Microsoft will continue with .NET Core. From this time you should prefer .NET Core on your projects.

    Official update (source):

    .NET 5 is the next major release of .NET Core following 3.1. We named this new release .NET 5 instead of .NET Core 4 for two reasons:

    • We skipped version numbers 4.x to avoid confusion with .NET Framework 4.x.
    • We dropped "Core" from the name to emphasize that this is the main implementation of .NET going forward. .NET 5 supports more types of apps and more platforms than .NET Core or .NET Framework.

    ASP.NET Core 5.0 is based on .NET 5 but retains the name "Core" to avoid confusing it with ASP.NET MVC 5. Likewise, Entity Framework Core 5.0 retains the name "Core" to avoid confusing it with Entity Framework 5 and 6.

      Start asking to get answers

      Find the answer to your question by asking.

      Ask question

      Explore related questions

      See similar questions with these tags.