将所有文件组合到一个.exe中。 (C#)
我有一个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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
右键单击项目→发布
与向导一起发布后,
一旦完成该文件夹位置,请单击“显示所有设置”:

现在选择“独立的”部署模式,然后检查“产物单文件”复选框
当您发布时,您将拥有一个单个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":

Now select a "Self-contained" deployment mode and check the "produce single file" checkbox
When you publish you will have a single exe file