如何使用 .NET Core 2.2 创建依赖于框架的可执行文件
How to Create Framework-Dependent Executables with .NET Core 2.2
如何使用 .NET Core 2.2 创建依赖于框架的可执行文件 (FDE)? MSDN 文档提到它们 here 作为 .NET Core 2.2 的新功能:
Framework-dependent executables (FDE)
Starting with .NET Core 2.2, you
can deploy your app as an FDE, along with any required third-party
dependencies. Your app will use the version of .NET Core that's
installed on the target system.
遗憾的是,分步示例仍然只涉及自包含和依赖于框架的部署 (FDD)。
.NET 核心 2.2
这样做的方法是指定一个运行时标识符,然后--self-contained false
:
dotnet publish -c Release -r win-x64 --self-contained false
这将生成不包含整个 .NET Core 框架的可执行文件。
.NET 核心 3.0
对于 .NET Core 3.0,可以使用以下内容:
dotnet publish -c Release -r win-x64 --no-self-contained
如何使用 .NET Core 2.2 创建依赖于框架的可执行文件 (FDE)? MSDN 文档提到它们 here 作为 .NET Core 2.2 的新功能:
Framework-dependent executables (FDE)
Starting with .NET Core 2.2, you can deploy your app as an FDE, along with any required third-party dependencies. Your app will use the version of .NET Core that's installed on the target system.
遗憾的是,分步示例仍然只涉及自包含和依赖于框架的部署 (FDD)。
.NET 核心 2.2
这样做的方法是指定一个运行时标识符,然后--self-contained false
:
dotnet publish -c Release -r win-x64 --self-contained false
这将生成不包含整个 .NET Core 框架的可执行文件。
.NET 核心 3.0
对于 .NET Core 3.0,可以使用以下内容:
dotnet publish -c Release -r win-x64 --no-self-contained