.NET

C# vs .NET

C# is not the only language we can run under .NET. In 99% of the cases it runs under .NET. .NET is a framework that enables running applications wrtitten in C#.

Some other .NET-compatible programming languages are F#, IronPython, VB etc.. The cool thing is that we can use the code written in one language in the code wrtitten in another. For example, we could have a C# class drived from a F# class. We can think of C# as airplane and .NET as airport.

.NET

Its most important part is the execution environment called Common Language Runtime, which is responsible for managing the memory, providing error handling, dealing with threads and more. .NET also provides a set of standard libraries, such as System.Linq, System.Collections and many more (those System libraries). 可以把.net理解为java世界里的JRE,which includes JVM(和CLR)很像,还有一些标准库。

.NET可以理解为一个平台,这个平台有三大支柱:
1. The Runtime。包含CLR。保证程序能跑起来。
2. The SDK。包含编译器,命令行工具。保证程序能造起来。
3. The standard libraries。包含那些System libraries等。不用重新发明轮子,拿来就能用。

.NET-related frameworks

Windows Forms / Windows Presentation Foundation (WPF): create desktop applications
ASP.NET MVC: web development
.NET MAUI: Cross-platform framework for creating native mobile and desktop apps.

.NET (Core) vs .NET Framework

时代背景: .NET Framework 诞生时,微软的策略是“全家桶绑定 Windows”。它被深度集成在 Windows 操作系统里。

挑战: 随着云计算(Linux 服务器)和移动端兴起,.NET Framework 太胖了,且离不开 Windows。

新生: 微软推倒重来,写了一个全新的、轻量级的、跨平台的引擎,最初叫 .NET Core

统一: 到了 2020 年,微软觉得“.NET Core”和“.NET Framework”名字太乱,直接把后续版本统一命名为 .NET(跳过版本号 4,直接从 .NET 5 开始)。

Scroll to Top