Venshilon
Venshilon

Reputation: 31

Two types of asp.net core Web Apps?

I've tried to create a new ASP.NET Core web application via Visual Studio and when the new project dialog opened I noticed that it offers two ASP.NET Core templates, one using .NET core and the other the. NET Framework. Why two templates? How can an ASP.NET core application use the regular .NET framework?

Upvotes: 2

Views: 190

Answers (2)

Martin Brown
Martin Brown

Reputation: 25310

ASP.Net Core is a separate thing from .Net Core and .Net Framework. So you are getting the option of running ASP.Net Core on .Net Core or ASP.Net Core on .Net Framework.

You would choose .Net Core if you want to be cross platform and run on Linux or Mac, where as you would choose .Net Framework if you want a full featured more mature framework that only runs on Windows.

See Choosing the Right .NET For You on the Server from ASP.NET Core Documentation.

Upvotes: 8

Sanket
Sanket

Reputation: 19997

In addition to Martin's answer, you can have 2 frameworks in same project (like .NET framework 4.6.1 and .NET core 1.0)

enter image description here

And during debug you can choose which framework to be used like this-

enter image description here

To configure both frameworks in your project, you just need to modify project.json like this-

   "frameworks": {
      "net461": {

      },
      "netcoreapp1.0": {
         "dependencies": {
            "Microsoft.NETCore.App": {
               "type": "platform",
               "version": "1.0.0"
            }
         },
         "imports": [
            "dotnet5.6",
            "portable-net45+win8"
         ]
      }
   }

Upvotes: 5

Related Questions