引用一段描述:Understanding the relationship between .NET Core and the .NET Framework。
.NET Core and the .NET Framework have (for the most part) a subset-superset relationship. .NET Core is named "Core" since it contains the core features from the .NET Framework, for both the runtime and framework libraries. For example, .NET Core and the .NET Framework share the GC, the JIT and types such as String
and List<T>
. We'll continue improving these components for both .NET Core and .NET Framework.
.NET Core was created so that .NET could be open source, cross platform and be used in more resource-constrained environments. We have also published a subset of the .NET Reference Source under the MIT license, so that you and the community can port additional .NET Framework features to .NET Core.
上面這兩段話,最重要的是前面兩句,.NET Core 和 .NET Framework 之間的關系,就是“subset-superset”,可以理解為子集的關系,.NET Framework 是一個大的概念,.NET Core 是從它里面分離出來的 Core(核心)部分,dudu 之前有個比喻:.NET Framework 是 Unix,.NET Core 是 Linux,其實這個比喻總感覺不太恰當,這樣比喻的觀點是 .NET Core 是從 .NET Framework 演化而來,有點像父類-子類關系,而不是子集關系。
回答園友的幾個問題:
1. .net framework 4.6 完全包括 .net core 5 嗎?也就是說用 .net core 5 寫的代碼,能直接使用 .net framework 4.6 編譯嗎?
--完全包括(4.6 是 .NET Framework 版本號,并不是 .NET Framework 基礎類庫版本號),.NET Framework 是大的概念,編譯是編譯器做的工作,當然概念中包含編譯器,也可以說可以編譯。
2. 除了 aps.net 外,.net core 5 還包括了哪些 .net framework 4.6 中的特性?WF 包括嗎?WCF 包括嗎?windows form 和 wpf 應該不包括吧?
--現在的 .NET Core 可以理解為在 GitHub 中的:corefx 和 coreclr,Web Forms 不包含,WCF 只包含客戶端,windows form 暫沒看到,wpf 不支持。
3. 為什么 .net core 直接就到 5 了,而沒有和 .net framework 用同樣的版本號?
--.NET Core 和 .NET Framework 是子集關系,所以版本號是獨立的。
文章列表