Some questions and doubts about the .NET Core


1 Why is there .NET Core this thing? That is what it is in order to solve the problem.

.NET Core is NET of ECMA , a new implementation criteria. Currently .NET been Framework , Mono , Unity or the like.

All of the original .NET program ( Mono is not within range) only in the windows run platform environment, which severely limits the .NET ecological extensible, .NET Core solve .NET cross-platform portable, can be Windows, Linux , MacOS develop and deploy a run.

2 What are the characteristics?

  • Cross-platform: can Windows , macOS and Linux operating systems to run on. Cross-platform ASP.NET Web applications, cross-platform console application, cross-platform libraries and frameworks, UWP applications.

  • Cross-architecture consistent: in multiple architectures (including x64 , x86 and ARM running code in the same behavior).

  • Command-line tools: includes commands are easy for local development and continuous integration scheme using the line tool.

  • Flexible deployment: it may be included in an application or user or computer installed parallel range. Can be used with Docker container use.

  • Compatibility: .NET Core through .NET Standard with the .NET Framework , Xamarin and Mono compatible.

  • Open Source: the .NET Core platform is open source, the use of MIT and Apache 2 license. .NET Core is a .NET Foundation project.

  • By the Microsoft Support: .NET Core from the Microsoft based .NET Core support to provide support.

3 .NET Core in .NET at and in what position? And the original .NET Freamwork have anything different?

.NET Core is .NET a technology of the new implementation, rather than the .NET Framework subset. .NET Core code and Framework code can co-exist in a solution.

.NET Core and .NET Framework on have achieved the .NET API (although sometimes different underlying implementation). Meanwhile, the .NET Core and .NET Framework are they do not have the API and functionality. For example, the .NET Framework have multiple .NET Core does not have a GUI framework and specific to the Windows of the API . Similarly, the .NET Core have .NET Framework lack of cross-platform functionality and API .

.NET Core does not support all .NET Framework application model. Specifically, it does not support ASP.NET Web Forms and ASP.NET MVC , but supports ASP.NET MVC Core ( has announced .NET Core 3 will support WPF and Windows Forms ) .

 


4 .NET Core What are the components?

.NET Core includes the following components:

  • .NET Core runtime : providing a type of system, the assembly is loaded, the garbage collector, the machine interoperability and other basic services. .NET Core Framework Library provides primitive data type, application type and the preparation of the basic utilities.

  • ASP.NET runtime : providing a frame to be generated based on the new cloud the Internet , for example, connected applications Web application, the IoT application backend and mobile.

  • .NET Core CLI tools and compilers ( Roslyn and F # ): provides .NET Core staff development experience.

  • dotnet tools : used to start the .NET Core application and CLI tools. Select and run when it hosted, to provide assembly loading strategy and launch applications and run-time tools.

Distribution of these components in the following manner:

  • .NET Core runtime - including .NET Core runtime libraries and frameworks.

  • ASP.NET Core runtime - including ASP.NET Core and .NET Core runtime libraries and frameworks.

  • SDK .NET Core - including .NET CLI tools, ASP.NET Core runtime and .NET Core runtime and framework.

5 and Mono comparison

Mono is the original cross-platform and open source .NET implementation in 2004 was first released. Think of it as a .NET Framework community cloning. Mono project team relies on Microsoft released an open .NET standards (especially the ECMA 335 ), in order to achieve compatibility.

On this perspective, the .NET Core and Mono is the same.

.NET Core and Mono main difference is that:

  • Application Model - Mono by Xamarin product supports .NET Framework application model (for example, Windows Forms ) and other application models (for example, Xamarin.iOS ) subset. The .NET Core does not support this content.

  • API - Mono use the same assembly name and composition of the elements of support .NET Framework API a large subset.

  • 平台 -- Mono 支持很多平台和 CPU

  • 开放源 -- Mono .NET Core 两者都使用 MIT 许可证,且都属于 .NET Foundation 项目。

  • 焦点 -- 最近几年,Mono 的主要焦点是移动平台,而 .NET Core 的焦点是云和桌面工作负载。

6 .NET Core能做些什么事情?

可以使用 C#Visual Basic F# 语言编写适用于 .NET Core 的应用程序和库。

 


7 怎么安装?


8 操作入口和界面?

.NET Core的项目工程使用CLI作为操作界面,它是一个命令行程序。常见的命令如下:


命令

说明

dotnet new

使用 C# 语言初始化用于类库或控制台应用程序的有效项目。

dotnet restore

还原在指定项目的 project.json 文件中定义的依赖项。依赖项通常是您在应用程序中使用的 NuGet 包。

dotnet build

生成您的代码! 此命令将生成适用于您的项目的中间语言 (IL) 二进制。如果项目是控制台应用程序,则产生的输出是可执行的,您可以立即运行。默认情况下,生成命令会将生成的程序集和可执行文件(如果适用)输出到调用位置目录的 bin 目录中。

dotnet test

如果不支持运行测试,则不会出现适合的工具。此命令让您可以使用在 project.json 文件中指定的运行程序运行一组测试。目前支持 xUnit NUnit 测试运行程序。

dotnet publish

发布在目标计算机上运行的应用程序。

dotnet pack

pack 命令会把您的项目打包成 NuGet 包。输出一组 nupkg 文件后,您可以将其上载至您的源,或使用本地文件夹替代将其用于还原操作。

dotnet run

运行命令将编译并运行您的应用程序。您可以将其看作没有 Visual Studio Ctrl+F5 模拟。


9 如何部署?与原先的.NET程序的部署有什么不同?



10 前景和规划

从目前微软在.NET Core上的更新速度以及开发计划上看,.NET Core的发展前景非常好,且逐步完善并向.NET Framework功能集合靠拢。比如.NET Core 3.0预览版即将支持WinFormWPF程序开发。

Mono的发展逐步转移到移动开发上。

 

Guess you like

Origin www.cnblogs.com/chorulex/p/10950141.html