gpt4 book ai didi

c# - 如何使用 .NET Core 2.2 创建依赖于框架的可执行文件

转载 作者:太空狗 更新时间:2023-10-29 18:28:34 24 4
gpt4 key购买 nike

如何使用 .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

关于c# - 如何使用 .NET Core 2.2 创建依赖于框架的可执行文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54075591/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com