【问题标题】:Using ILMerge to merge multiple dll files into one dll, some of the dll files cannot be used使用ILMerge将多个dll文件合并为一个dll,部分dll文件无法使用
【发布时间】:2014-10-16 17:45:57
【问题描述】:

我有一个正常工作的库项目,它正在使用流畅的 nhibernate、npgsql、enyim.caching dll 文件,我使用 ilmerge 将所有文件合并为一个,然后合并的 dll 文件被引用另一个项目,然后它不起作用,它抱怨找不到 enyim.caching.dll 的程序集,以及缺少 nhibernate 的配置 我用于合并的命令如下

ilmerge /targetplatform:v4 /target:library /out:testmerged.dll Release/Enyim.Caching.dll Release/FluentNHibernate.dll Release/Iesi.Collections.dll Release/log4net.dll Release/Mono.Security.dll Release/NHibernate.Caches.SysCache.dll Release/NHibernate.dll Release/Npgsql.dll Release/mylib.dll 

引用它的项目的错误:

Message = "'FluentNHibernate.Automapping.IAutoClasslike, testmerged, Version=2.12.0.0, Culture=neutral, PublicKeyToken=null' 缺少无参数构造函数。"

Message = "无法加载文件或程序集 'Enyim.Caching' 或其依赖项之一。系统找不到指定的文件。"

我注意到这2个dll文件使用的是运行时版本v2.0.50727,并且运行时版本v4.0.30319下的所有文件都可以正常工作。

那么,你们可以就如何解决这个问题提出任何建议吗? 谢谢

【问题讨论】:

    标签: ilmerge


    【解决方案1】:

    好的,我终于找到了 enyim.caching.dll 的解决方案 我必须添加

    <sectionGroup name="enyim.com">
        <section name="memcached" type="Enyim.Caching.Configuration.MemcachedClientSection, testmerged"/>
      </sectionGroup>
      <section name="memcached" type="Enyim.Caching.Configuration.MemcachedClientSection, testmerged"/>
    

    在我的配置文件中

    【讨论】:

      猜你喜欢
      • 2011-05-09
      • 2011-10-26
      • 2011-06-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-04
      • 1970-01-01
      相关资源
      最近更新 更多