.Net 核心优势 - 并行执行需要明确
.Net core benefit - side by side execution need clarity
微软 ebook 中提到 .net 核心的好处之一是您可以 运行 在同一台机器上并排使用 .NET 版本的应用程序,
我在这里的困惑甚至在 .net framework 中相同 feature 可用,其中指向不同 .net framework 版本的应用程序可以 运行 在同一台机器上一起使用。
那么它是 .net 核心的额外好处,还是我遗漏了什么?
经典的 .NET Framework 只能运行 CLR 2 (2.0-3.5) 和 CLR 4 (4.0+) 版本并排。
如果您在计算机上安装 .NET Framework 4.7.1(或升级到带有该版本的 windows 版本),所有为 4.0+ 构建的应用程序都将 运行 在该框架上。
.NET Core 可以 运行 所有版本并排。例如2.0.3 和 2.0.4 将安装到不同的目录中。但是,它会自动前滚到补丁版本,因为它们包含安全性和错误修复。但如果您为 2.0.4 编译并且安装了 2.1.0 和 2.0.4,它不会自动 运行 您的应用程序在 2.1.0 上。
在 .NET Core 3.0 及更高版本中,可以安装运行时side-by-side 仅当它们的主要或次要版本不同时。来自 https://docs.microsoft.com/en-us/dotnet/core/releases-and-support(自 03/22/2022):
Release types
Information about the type of each release is encoded in the version
number in the form major.minor.patch.
For example:
.NET 5 and NET 6 are major releases.
.NET Core 3.1 is the first minor release after the .NET Core 3.0 major release.
.NET Core 5.0.15 is the fifteenth patch for .NET 5.
Major releases
Major releases include new features, new public API surface area, and
bug fixes. Examples include .NET 5 and .NET 6. Due to the nature of
the changes, these releases are expected to have breaking changes.
Major releases install side by side with previous major releases.
Minor releases
Minor releases also include new features, public API surface area, and
bug fixes, and may also have breaking changes. An example is .NET Core
3.1. The difference between these and major releases is that the magnitude of the changes is smaller. An application upgrading from
.NET Core 3.0 to 3.1 has a smaller jump to move forward. Minor
releases install side by side with previous minor releases. Servicing
updates
Servicing updates (patches) ship almost every month, and these updates
carry both security and non-security bug fixes. For example, .NET
5.0.8 is the eighth update for .NET 5. When these updates include security fixes, they're released on "patch Tuesday", which is always
the second Tuesday of the month. Servicing updates are expected to
maintain compatibility. Starting with .NET Core 3.1, servicing updates
are upgrades that remove the preceding update. For example, the latest
servicing update for 3.1 removes the previous 3.1 update upon
successful installation.
例如,您可以安装 .NET 5 和 .NET 6 side-by-side 或 3.0 和 3.1,但不能安装 5.0.4 和 5.0.15。
微软 ebook 中提到 .net 核心的好处之一是您可以 运行 在同一台机器上并排使用 .NET 版本的应用程序, 我在这里的困惑甚至在 .net framework 中相同 feature 可用,其中指向不同 .net framework 版本的应用程序可以 运行 在同一台机器上一起使用。
那么它是 .net 核心的额外好处,还是我遗漏了什么?
经典的 .NET Framework 只能运行 CLR 2 (2.0-3.5) 和 CLR 4 (4.0+) 版本并排。
如果您在计算机上安装 .NET Framework 4.7.1(或升级到带有该版本的 windows 版本),所有为 4.0+ 构建的应用程序都将 运行 在该框架上。
.NET Core 可以 运行 所有版本并排。例如2.0.3 和 2.0.4 将安装到不同的目录中。但是,它会自动前滚到补丁版本,因为它们包含安全性和错误修复。但如果您为 2.0.4 编译并且安装了 2.1.0 和 2.0.4,它不会自动 运行 您的应用程序在 2.1.0 上。
在 .NET Core 3.0 及更高版本中,可以安装运行时side-by-side 仅当它们的主要或次要版本不同时。来自 https://docs.microsoft.com/en-us/dotnet/core/releases-and-support(自 03/22/2022):
Release types
Information about the type of each release is encoded in the version number in the form major.minor.patch.
For example:
.NET 5 and NET 6 are major releases. .NET Core 3.1 is the first minor release after the .NET Core 3.0 major release. .NET Core 5.0.15 is the fifteenth patch for .NET 5.
Major releases
Major releases include new features, new public API surface area, and bug fixes. Examples include .NET 5 and .NET 6. Due to the nature of the changes, these releases are expected to have breaking changes. Major releases install side by side with previous major releases. Minor releases
Minor releases also include new features, public API surface area, and bug fixes, and may also have breaking changes. An example is .NET Core 3.1. The difference between these and major releases is that the magnitude of the changes is smaller. An application upgrading from .NET Core 3.0 to 3.1 has a smaller jump to move forward. Minor releases install side by side with previous minor releases. Servicing updates
Servicing updates (patches) ship almost every month, and these updates carry both security and non-security bug fixes. For example, .NET 5.0.8 is the eighth update for .NET 5. When these updates include security fixes, they're released on "patch Tuesday", which is always the second Tuesday of the month. Servicing updates are expected to maintain compatibility. Starting with .NET Core 3.1, servicing updates are upgrades that remove the preceding update. For example, the latest servicing update for 3.1 removes the previous 3.1 update upon successful installation.
例如,您可以安装 .NET 5 和 .NET 6 side-by-side 或 3.0 和 3.1,但不能安装 5.0.4 和 5.0.15。