将所有文件组合到一个.exe中。 (C#)

发布于 2025-02-03 16:28:47 字数 106 浏览 5 评论 0原文

我有一个Winform Visual Studio 2022项目,该项目是C#,当我构建它时,它会输出4个文件,1个DLL和2。JSON文件。如何将所有文件组合到一个.exe文件中以使其更易于分发?

I have a WinForm Visual studio 2022 project that is C# and when I build it, it outputs 4 files, 1 dll, and 2 .json files with the exe. How would I combine all the files into one .exe file to make it easier to distribute?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

拿命拼未来 2025-02-10 16:28:47

右键单击项目→发布

与向导一起发布后,

一旦完成该文件夹位置,请单击“显示所有设置”:

现在选择“独立的”部署模式,然后检查“产物单文件”复选框

”

当您发布时,您将拥有一个单个EXE文件

Right click project → Publish

Go along with the Wizard to publish to a folder location

Once you are done with that click "show all settings":
enter image description here

Now select a "Self-contained" deployment mode and check the "produce single file" checkbox

enter image description here

When you publish you will have a single exe file

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文