2

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?

1
  • Who two templates? So you can choose which to target. And you can target both by modifying the configuration after you create the application. Commented Jul 29, 2016 at 12:26

2 Answers 2

8

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.

Sign up to request clarification or add additional context in comments.

Comments

5

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"
         ]
      }
   }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.