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

查看:364
本文介绍了在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.

推荐答案

您可以将多个DLL与ILMERGE合并:

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 = zh-CN

Download here:
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天全站免登陆