在 C# 中静态链接 [英] Linking statically in C#

查看:22
本文介绍了在 C# 中静态链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为 CMS 开发一个模块.此模块作为类库 DLL 分发.

I'm working on a module for a CMS. This module is distributed as a class library DLL.

我想在这个模块中使用几个实用程序库.无论如何我可以静态链接这些库,这样我就不必分发几个 DLL(从而分别分发我的实用程序库)?

I have several utility libraries I'd like to use in this module. Is there anyway I can link these libraries statically so I won't have to distribute several DLL's (thereby distributing my utility libraries separately)?

我只想拥有一个 DLL.

I would like to have only one DLL.

推荐答案

您可以使用 ILMERGE 合并许多 DLL:

You can merge your many DLLs with ILMERGE:

http://research.microsoft.com/~mbarnett/ILMerge.aspx

自己没试过.希望有帮助.

Haven't tried it myself. Hope it helps.

从这里下载:
http://www.microsoft.com/downloads/details.aspx?familyid=22914587-B4AD-4EAE-87CF-B14AE6A939B0&displaylang=en

简要说明 (来自下载页面)
ILMerge 是用于将多个 .NET 程序集合并为单个 .NET 程序集的实用程序.它适用于可执行文件和 DLL,并带有几个用于控制输出处理和格式的选项.有关详细信息,请参阅随附的文档.

Brief Description (from download-page)
ILMerge is a utility for merging multiple .NET assemblies into a single .NET assembly. It works on executables and DLLs alike and comes with several options for controlling the processing and format of the output. See the accompanying documentation for details.

这篇关于在 C# 中静态链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆