从 C# Windows 应用程序创建 .exe

发布于 2024-11-25 05:36:31 字数 97 浏览 2 评论 0原文

我创建了一个 Visual Studio 2010 项目,它创建了一个 Windows 窗体 - 它引用了许多其他 DLL。

如何将其打包到单个 .exe 文件中?

I have a created a visual studio 2010 project that creates a windows form - it references numerous other dll's.

How can I wrap this up in to a single .exe file?

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

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

发布评论

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

评论(4

俯瞰星空 2024-12-02 05:36:31

ILMerge 是您使用 /t:exe 选项寻找的内容。

示例调用如下所示:

ilmerge.exe exefile.exe [dlls-to-internalize.dll ..] /out:exefile-out.exe /t:exe

使用 ILMerge 的示例用法将多个 dll 打包成一个并将它们内部化可以在这里找到:dotlesscss buildfile

有关使用 ILMerge 的详细信息,请访问 ILMerge 网站
您还可以通过 NuGet 通过 Chocolatey

它允许您通过重写引用将多个.NET 程序集打包到一个文件中。
如果您向某人提供库并且不希望与您内部使用的库引起依赖项冲突,您还可以内部化您的依赖项。

ILMerge is what you are looking for with the /t:exe option.

A sample call would look like this:

ilmerge.exe exefile.exe [dlls-to-internalize.dll ..] /out:exefile-out.exe /t:exe

A sample usage of using ILMerge to pack up multiple dlls into one and internalizing them can be found here: dotlesscss buildfile

More info on using ILMerge can be found on the ILMerge Website.
You can also get it through NuGet via Chocolatey

It allows you to pack multiple .NET assemblies into one file by rewriting the references.
You can also internalize your dependencies in case you are supplying a library to someone and don't want to cause dependency conflicts with libraries you are internally using.

ぽ尐不点ル 2024-12-02 05:36:31

正如发布的,ILMerge 是一个选项,另一个选项是来自 RedGate 等的“SmartAssembly”。

所有这些都不做的是内部化本机 DLL - 这是 Windows API 的限制...因此任何本机 DLL 的依赖项都必须一起提供与 EXE 一起。

As posted ILMerge is one option, another is "SmartAssembly" from RedGate etc.

What all these DO NOT do is internalizing native DLLs - that's a limitation in the Windows API... so any dependency which is a native DLL has to be shipped along with the EXE.

默嘫て 2024-12-02 05:36:31
 1. Select Configuration Manager and check parameter such as debug/release or x86/new.
    2.Select Release instead of debug from drop down menu near debug button(Visual studio framework).
    3. Click on build and then build yourApplicationName.
    4. Goto Your program folder->bin->release->yourApplicationName.exe.
    5. yourApplicationName.exe is ready to use.
    Thanks
 1. Select Configuration Manager and check parameter such as debug/release or x86/new.
    2.Select Release instead of debug from drop down menu near debug button(Visual studio framework).
    3. Click on build and then build yourApplicationName.
    4. Goto Your program folder->bin->release->yourApplicationName.exe.
    5. yourApplicationName.exe is ready to use.
    Thanks
一抹苦笑 2024-12-02 05:36:31

转到您的应用程序->bin->dubug->yourapplicationname.exe
它是自动生成的,但由于调试信息较少,发布文件夹中的 exe 比调试速度更快。

Go to Your Application->bin->dubug->yourapplicationname.exe
It is automatically generated but exe from release folder is more faster than the debug due to less information of debug.

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