简体   繁体   中英

What is the difference between creating a project ASP.NET Core (.NET Core) and ASP.NET Core (.NET Framework)

在此处输入图片说明

I don't see clearly the main difference between the last two project types, actually which sense have the last one? .NET Core and .NET Framework?

The difference is whether you will be targeting the .Net Core Framework or the Full .Net Framework. And this difference shows up for example in the project.json file.

Another thing to know about is that when you use the "ASP.NET Core Web Application (.NET Framework)" template it's much easier to link to .Net Library Projects that target the full framework when using Visual Studio. It's possible to do it using the "ASP.NET Core Web Application (.NET Core)" template but it requires some manual editing of the project.json file.

It may also be worth mentioning that if you target the Full Framework the web application must be deployed on Windows, whereas targeting the .Net Core framework allows the web application to be deployed to non-Windows environments. But the .Net Core Framework is not as feature rich as the Full Framework. (It has no drawing routines for resizing images for instance). You can read more about choosing the right framework here: https://docs.asp.net/en/1.0.0-rc1/getting-started/choosing-the-right-dotnet.html

Either way, no matter which of these two templates you select, you will be creating a project for creating an ASP.NET Core application.

Some differences in the actual projects created

Here is what the solution looks like in Visual Studio 2015 Update 3 when "ASP.NET Core Web Application (.NET Core)" is chosen (with Empty option):

生病了

And here is its project.json file:

在此处输入图片说明

Here is what the solution looks like in Visual Studio 2015 Update 3 when "ASP.NET Core Web Application (.NET Framework)" is chosen (with Empty option):

在此处输入图片说明

And here is its project.json file:

在此处输入图片说明

ASP.NET Core can run on top of .NET Core or the full .NET Framework . So there's a template depending on whether you want to build on .NET Core or the full .NET Framework.

Here's an infographic that Microsoft put together that visually demonstrates the concept:

显示在 .NET Framework 和 .NET Core 上运行的 ASP.NET Core 的信息图

No matter which template you choose, you can always edit your configuration to target both at the same time. But the templates just help you get started with one or the other.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM