{
  "schemaVersion": "0.11.0",
  "canonical": "https://www.pystone.net/notes/dotnet-version-notes/",
  "atlas": "https://www.pystone.net/?node=dotnet-version-notes#knowledge-atlas",
  "markdown": "https://www.pystone.net/notes/dotnet-version-notes.md",
  "context": "https://www.pystone.net/notes/dotnet-version-notes.context.json",
  "knowledgeVersion": "224c990773de.5fa8af6e39fa",
  "build": {
    "siteCommit": "224c990773de166d23a886306577dd90379529ce",
    "notesCommit": "5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a",
    "builtAt": "1970-01-01T00:00:00.000Z",
    "version": "224c990773de.5fa8af6e39fa"
  },
  "id": "note:dotnet-version-notes",
  "slug": "dotnet-version-notes",
  "title": "dotNET版本相关",
  "type": "note",
  "visibility": "public",
  "idStability": "rename-stable",
  "author": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "publisher": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "aliases": [],
  "summary": "dotNET版本相关",
  "contentRole": "unspecified",
  "isMoc": false,
  "mocRecognition": "none",
  "generated": false,
  "attribution": "unspecified",
  "domain": "10-计算机、信息技术与工程",
  "tags": [],
  "mocs": [],
  "contentHash": "41fc9fca376e4d849b383c93032b3200b2beaa1c78c7682592b6f68155f0200b",
  "assets": [
    {
      "reference": "assets/0023 - dotNET版本相关__resource-001-b7d3f4ae7d2d.png",
      "url": "/media/b903df21bb07342003a3.png",
      "mediaType": "image/png",
      "contentHash": "b903df21bb07342003a38f2eea7efae65a2105d5b125de93394012d4b083e445",
      "byteLength": 224069,
      "width": 884,
      "height": 354
    },
    {
      "reference": "assets/0023 - dotNET版本相关__resource-002-1f44e051cde3.png",
      "url": "/media/bb4f0f1a62121711df70.png",
      "mediaType": "image/png",
      "contentHash": "bb4f0f1a62121711df70f53c0646c6de578da1bc0f0c604210618f7de587e4ca",
      "byteLength": 96403,
      "width": 626,
      "height": 462
    },
    {
      "reference": "assets/0023 - dotNET版本相关__resource-004-e2f24e2c7c54.png",
      "url": "/media/d48981d292a00b6aac22.png",
      "mediaType": "image/png",
      "contentHash": "d48981d292a00b6aac2258efe11463b89386da07f4bcc041729f309c480c9a48",
      "byteLength": 71971,
      "width": 1581,
      "height": 853
    },
    {
      "reference": "assets/0023 - dotNET版本相关__resource-003-8f78f3635b1f.png",
      "url": "/media/7ba6ef88310588e1ff7e.png",
      "mediaType": "image/png",
      "contentHash": "7ba6ef88310588e1ff7eecf3a4325460110d6cb1dbeda1d781ff7633eb0b74e1",
      "byteLength": 146766,
      "width": 719,
      "height": 327
    }
  ],
  "headings": [
    {
      "depth": 1,
      "text": "dotNET版本相关",
      "anchor": "dotnet版本相关",
      "citation": "https://www.pystone.net/notes/dotnet-version-notes/#dotnet%E7%89%88%E6%9C%AC%E7%9B%B8%E5%85%B3"
    },
    {
      "depth": 2,
      "text": "相关概念",
      "anchor": "相关概念",
      "citation": "https://www.pystone.net/notes/dotnet-version-notes/#%E7%9B%B8%E5%85%B3%E6%A6%82%E5%BF%B5"
    },
    {
      "depth": 2,
      "text": "C#版本与.NET版本对应关系以及各版本的特性",
      "anchor": "c版本与net版本对应关系以及各版本的特性",
      "citation": "https://www.pystone.net/notes/dotnet-version-notes/#c%E7%89%88%E6%9C%AC%E4%B8%8Enet%E7%89%88%E6%9C%AC%E5%AF%B9%E5%BA%94%E5%85%B3%E7%B3%BB%E4%BB%A5%E5%8F%8A%E5%90%84%E7%89%88%E6%9C%AC%E7%9A%84%E7%89%B9%E6%80%A7"
    },
    {
      "depth": 2,
      "text": ".Net Framework Vs .Net Core Vs .Net Standard",
      "anchor": "net-framework-vs-net-core-vs-net-standard",
      "citation": "https://www.pystone.net/notes/dotnet-version-notes/#net-framework-vs-net-core-vs-net-standard"
    },
    {
      "depth": 3,
      "text": ".Net Framework",
      "anchor": "net-framework",
      "citation": "https://www.pystone.net/notes/dotnet-version-notes/#net-framework"
    },
    {
      "depth": 3,
      "text": ".Net Core",
      "anchor": "net-core",
      "citation": "https://www.pystone.net/notes/dotnet-version-notes/#net-core"
    },
    {
      "depth": 3,
      "text": ".Net Standard",
      "anchor": "net-standard",
      "citation": "https://www.pystone.net/notes/dotnet-version-notes/#net-standard"
    },
    {
      "depth": 3,
      "text": "Other links",
      "anchor": "other-links",
      "citation": "https://www.pystone.net/notes/dotnet-version-notes/#other-links"
    },
    {
      "depth": 2,
      "text": "Unity Api Compability Level如何选择",
      "anchor": "unity-api-compability-level如何选择",
      "citation": "https://www.pystone.net/notes/dotnet-version-notes/#unity-api-compability-level%E5%A6%82%E4%BD%95%E9%80%89%E6%8B%A9"
    },
    {
      "depth": 3,
      "text": "当使用.NET 4.x profile时，添加assembly引用",
      "anchor": "当使用net-4x-profile时添加assembly引用",
      "citation": "https://www.pystone.net/notes/dotnet-version-notes/#%E5%BD%93%E4%BD%BF%E7%94%A8net-4x-profile%E6%97%B6%E6%B7%BB%E5%8A%A0assembly%E5%BC%95%E7%94%A8"
    },
    {
      "depth": 2,
      "text": "Ref",
      "anchor": "ref",
      "citation": "https://www.pystone.net/notes/dotnet-version-notes/#ref"
    }
  ],
  "claims": [],
  "outgoing": [],
  "incoming": [
    {
      "id": "note:programming-languages-and-runtimes",
      "title": "编程语言与运行时",
      "url": "https://www.pystone.net/notes/programming-languages-and-runtimes/",
      "atlas": "https://www.pystone.net/?node=programming-languages-and-runtimes#knowledge-atlas",
      "label": "编程语言与运行时",
      "origin": "explicit",
      "humanReviewed": true,
      "context": ".NET与CSharp中的“dotNET版本相关”导航项",
      "citation": "https://www.pystone.net/notes/programming-languages-and-runtimes/#net%E4%B8%8Ecsharp"
    }
  ],
  "contentMarkdown": "# dotNET版本相关\n\n﻿# dotNET版本相关\n\n> 创建时间：2021/5/18 11:41\n\n* 相关概念\n  * C#版本与.NET版本对应关系以及各版本的特性\n  * .Net Framework Vs .Net Core Vs .Net Standard\n    * .Net Framework\n    * .Net Core\n    * .Net Standard\n    * Other links\n  * Unity Api Compability Level如何选择\n    * 当使用.NET 4.x profile时，添加assembly引用\n  * Ref\n\n## 相关概念\n\n  * Intermediate Language (IL) - .Net code is compiled into a special language called Intermediate Language. It is stored in .dll or .exe files.\n\n  * Common language runtime (CLR) - Common language runtime handles the execution of application.\n\n  * Just In Time (JIT) - CLR used assembly and turn into machine code through process. This process is known as Just In time (JIT) compilation.\n\n  * Base Class Library (BCL) - Microsoft provided reusable library which can be used in your application while developing code.\n\n> Expect these concepts; .Net framework has CTS (Common Type System), Garbage collection, Memory management etc.\n\n## C#版本与.NET版本对应关系以及各版本的特性\n\nhttps://www.cnblogs.com/MingsonZheng/p/11273700.html\n\n## .Net Framework Vs .Net Core Vs .Net Standard\n\n### .Net Framework\n\nMicrosoft introduced .Net framework in 2000 to build Web and Windows applications (desktop applications) using different languages like C#, Visual Studio, F# etc.\n\nIn simple words, we can say, .Net Framework can be used for web and window application development which works with **Windows operating system**.\n\nThe latest available version of .Net Framework is 4.8.\n\n### .Net Core\n\n**.NET Core: This is the latest .NET implementation. It’s open source and available for multiple OSes. With .NET Core, you can build cross-platform console apps and ASP.NET Core Web applications and cloud services.\n**\n\nNow the IT Industry needs platforms which can be used with different operating systems.\n\nAs .Net framework was working with only Windows, Microsoft introduced **.Net core** for **cross platform** as per market demand.\n\n![](assets/0023 - dotNET版本相关__resource-001-b7d3f4ae7d2d.png)\n\n### .Net Standard\n\n**.NET Standard: This is the set of fundamental APIs (commonly referred to as base class library or BCL) that all .NET implementations must implement. By targeting .NET Standard, you can build libraries that you can share across all your .NET apps, no matter on which .NET implementation or OS they run.**\n\nBefore starting with .Net Standard, let’s discuss .Net framework and .Net core architecture using the below diagram. All three frameworks have their own base class libraries.\n\n![](assets/0023 - dotNET版本相关__resource-002-1f44e051cde3.png)\n\nLet’s assume that I have shared a library developed in .Net Framework. I want to use this Library in multiple projects in which some of the projects have been created in .Net core. That’s where the problem starts.\n\n![](assets/0023 - dotNET版本相关__resource-004-e2f24e2c7c54.png)\n\nAl frameworks have common BCLs called .Net standard. .Net standard is a set of APIs that all .Net framework implements.\n\n![](assets/0023 - dotNET版本相关__resource-003-8f78f3635b1f.png)\n\n### Other links\n\nhttps://stackoverflow.com/questions/42939454/what-is-the-difference-between-net-core-and-net-standard-class-library-project\n\nhttp://www.mukeshkumar.net/articles/dotnetcore/dotnet-framework-vs-dotnet-core-vs-dotnet-standard\n\n## Unity Api Compability Level如何选择\n\n.NET Standard 2.0 对平台的支持性更广、兼容性更好。.NET Standard 2.0的API是.NET 4.x的子集。\n或者说，.NET 4.x支持的API更多一些，兼容.NET Standard 2.0，但是有些API在有些平台上是不兼容的。\nUnity默认选择的是.NET Standard 2.0，如果想要跨平台兼容，那么就选Standard 2.0。如果使用的外部类库或者脚本里面调用的API不被Standard 2.0支持，再考虑换成4.x来试试。\n\n### 当使用.NET 4.x profile时，添加assembly引用\n\n当使用NET Standard 2.0时，API profile中的所有assemblies都是默认被引用且可用的。但是当使用.NET 4.x profile时，某些assemblies没有被Unity默认引用。此时需要手动添加assembly引用。如果缺少assembly的引用，在Visual Studio中就会报错。\n\n在Unity工程的Assets根目录创建一个文本文件，命名为 **mcs.rsp** 。其中填入 -r:System.Net.Http.dll这样的行来添加引用。然后重启Unity。\n\n> 因为Visual Studio打开Unity工程时会重新生成.csproj和.sln文件，因为不能直接在Visual Studio中添加assembly引用，否则再次开启工程时会丢失这些修改。\n\n## Ref\n\nhttps://www.c-sharpcorner.com/article/net-framework-vs-net-core-vs-net-standard/\n\nhttps://docs.microsoft.com/en-us/archive/msdn-magazine/2017/september/net-standard-demystifying-net-core-and-net-standard\n\nhttps://docs.unity3d.com/2019.1/Documentation/Manual/dotnetProfileSupport.html\n\nhttps://www.jianshu.com/p/593ec64aa9c2\n"
}
