.NET architecture development should be aware of

  .NET procedure is based on .NET framework, .NET Core, Mono, UWP] [.NET achieve development and operation, to achieve the above definition of [.NET] Standard Standard Specification referred .NET

 L1:.NET Standard

  .NET API is a set of standards set by the upper three kinds of [.NET] achieve the Basic Class Library implemented a more formal statement by the specification of a collection of the unified contract, this collection ensures that the .NET implementation of different [between] portability, make your code run everywhere.

  .NET Standard is a target framework. If your code is for a version of the .NET Standard, and that it can support a version of the .NET Standard run on any .NET implementation.

 

L2: [.NET achieved]

  The figure given is Microsoft's effort to support and maintenance There are three major [realize] .NET: .NET Framework, .NET Core, Mono

  ①.NET Framework

    The earliest .NET implementation, begin to implement .NET Standard version 4.5+, the code for a specific .NET Standard version can be compiled and run on a specific version of the .NET Framework 4.5+ platform. https://docs.microsoft.com/en-us/dotnet/standard/frameworks

    Early compare Microsoft closed source, .NET Framework is facing windows desktop environment for building and design, design WINFORM, ASP.NET applications for different forms, WPF

  ②.NET Core

   In recent years, Microsoft is embracing open-source crystal, .NetCore is a cross-platform .NET implementation [], because the native implements .NET Standard (no version burden), for .NETStandard code can be compiled on .NET Core Platform and run.

   For Web applications .NetCore prepared ASP.NECore framework, Microsoft is positioning the new generation of high-performance, open source, cross-platform Web development framework, the latest stable version 2.2

     In addition .NetCore 3.0 will soon support WINFORM, WPF, this will be fully covered by the application form .Net Framework supports.

  ③ Mono .NET implementation [is] a small run-time, driving Xamarin, for android, ios and other development, support for all current public version of the .NET standard.

 

 I work in .NetCore platform in recent years, some of the voice of experience on macro, for reference.

 1: Select .NetCore deployment targets

  Deployment target is defined in the Target Framework Moniker, we decided to deploy positioning procedure, common the following two kinds:

  • netstandard

  • netcoreapp

  In practice: an early project may be positioned to netstandard, later as the project evolved, more and more dependent libraries, most will become netcoreapp.

  The L1 The .NetStandard is a target framework, a plurality of intended run-time (across .Net Framework, .NET Core, XAMARIN) program running on the target should be in this frame.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netstandard1.6</TargetFramework>
  </PropertyGroup>
</Project>

   Accompanied by the evolution of the project, the program depends on some libraries may be in for .NetCore version; see the actual production, deployment environment will deploy a .Net Core run-time, so the latter project will evolve into a great possibility for .Net Core runtime deployment.

<TargetFramework>netcoreapp2.2</TargetFramework>

 

Two: there is more than development environment SDK, multi Runtime version, you should be aware of .NET Core tools, SDK and runtime versions of the selected policy.

  ① When running SDK command will be used to install the latest version of Command

SDK includes command DOTNET new new / DOTNET RUN, even if the project generates file is specified for an earlier version of the run or install the latest version of the SDK is a preview version, SDK still use the latest version of the SDK is installed

  ② target frame labeled target framework monikers defined compile-time API

API compiler .NetCore program is defined in the Target framework Moniker project file in,

<TargetFramework>netcoreapp2.0</TargetFramework>

<TargetFrameworks>netcoreapp2.0;net47</TargetFrameworks>

   ③ run .NetCore program (standalone .NetCore framework program), on the server before deploying roll version of the policy will apply

Specified in the project file the netcoreapp2.0, in the deployment environment 2.0.4 is the latest version of the runtime installed, it will use run-time version 2.0.4

  ④ The publisher self-contained, self contained deployment will include the specified operation

When deploying a self-contained .NetCore program, the deployment file contains .NetCore run-time library files and programs dependent, self-contained project does not depend on the deployment server run-time environment, version selection occurs at runtime release stage, rather than in the operational phase .
Currently self-contained .NetCore program uses small scenes, is generally required for the program applied to a variety of complex customer environments, this deployment package in run-time environment and dependence, customers do not have to know ahead of time the server is running.

  Tip: ① strategies for some special application scenarios, if the project needs to use an earlier version of the SDK, you can specify the file in the earlier version in global.json avoid new strategy

{
  "sdk": {
    "version": "2.2.3"
  }
}

   This article does not explain at great length .NETCore SDK and CommandLine usage, you can copy or imitate, specifically pointed out  to select the deployment target , multi SDK selection policy experience, the reader can refer to the application.

 

Author: JulianHuang

Thank you for your read, any questions please correct me bold; find it useful, please below or add attention.

Welcome to reprint this article, but please keep this paragraph statement, and noted the article page article in the apparent position of the author and link the original.

Guess you like

Origin www.cnblogs.com/JulianHuang/p/11126915.html