简体   繁体   English

创建项目 ASP.NET Core (.NET Core) 和 ASP.NET Core (.NET Framework) 有什么区别

[英]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? .NET Core 和 .NET Framework?

The difference is whether you will be targeting the .Net Core Framework or the Full .Net Framework.不同之处在于您的目标是 .Net Core Framework 还是完整的 .Net Framework。 And this difference shows up for example in the project.json file.例如,这种差异显示在 project.json 文件中。

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.另一件需要了解的事情是,当您使用“ASP.NET Core Web 应用程序 (.NET Framework)”模板时,在使用 Visual Studio 时链接到面向完整框架的 .Net 库项目要容易得多。 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.可以使用“ASP.NET Core Web 应用程序 (.NET Core)”模板来实现,但需要对 project.json 文件进行一些手动编辑。

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.还值得一提的是,如果您面向完整框架,则 Web 应用程序必须部署在 Windows 上,而面向 .Net Core 框架则允许将 Web 应用程序部署到非 Windows 环境。 But the .Net Core Framework is not as feature rich as the Full Framework.但是 .Net Core 框架不像完整框架那样功能丰富。 (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您可以在此处阅读有关选择正确框架的更多信息: 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.无论哪种方式,无论您选择这两个模板中的哪一个,您都将创建一个用于创建 ASP.NET Core 应用程序的项目。

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):以下是在选择“ASP.NET核心Web应用程序(.NET Core)”(具有空选项)时,解决方案在Visual Studio 2015更新中的内容如下所示。

生病了

And here is its project.json file:这是它的 project.json 文件:

在此处输入图片说明

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):以下是在选择“ASP.NET核心Web应用程序(.NET Framework)”(具有空选项)时,解决方案在Visual Studio 2015更新中的内容如下所示

在此处输入图片说明

And here is its project.json file:这是它的 project.json 文件:

在此处输入图片说明

ASP.NET Core can run on top of .NET Core or the full .NET Framework . ASP.NET Core可以在.NET Core或完整的.NET Framework之上运行。 So there's a template depending on whether you want to build on .NET Core or the full .NET Framework.因此,有一个模板取决于您是要在 .NET Core 还是完整的 .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.但模板只是帮助您开始使用其中一个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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