Fork me on GitHub

.NET Core 和 .NET Framework 之间的关系

引用一段描述: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 是子集关系,所以版本号是独立的。

参考:.NET Core与.NET Framework、Mono之间的关系

posted @   田园里的蟋蟀  阅读(3143)  评论(6编辑  收藏  举报
编辑推荐:
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· 展开说说关于C#中ORM框架的用法!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
点击右上角即可分享
微信分享提示