jacky jiang
jacky jiang

Reputation: 31

Using ILMerge to merge multiple dll files into one dll, some of the dll files cannot be used

I have a library project that is working properly, and it is using the fluent nhibernate, npgsql, enyim.caching dll files, I use the ilmerge to combine all files into one, and after that the merged dll file is referenced by another project, then it doesn't work, it complains cannot find assembly of enyim.caching.dll, and the missing configuration of nhibernate The command I am using for merging is below

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 

The error from the project referencing it:

Message = "'FluentNHibernate.Automapping.IAutoClasslike, testmerged, Version=2.12.0.0, Culture=neutral, PublicKeyToken=null' is missing a parameterless constructor."

Message = "Could not load file or assembly 'Enyim.Caching' or one of its dependencies. The system cannot find the file specified."

I pay attention to those 2 dll files are using the runtime version v2.0.50727, and all files under runtime version v4.0.30319 are working correctly.

So, can you guys give any suggestion how to fix this issue? Thanks

Upvotes: 2

Views: 1433

Answers (1)

jacky jiang
jacky jiang

Reputation: 31

Ok, finally, I found the solution to enyim.caching.dll I have to add

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

in my configuration file

Upvotes: 1

Related Questions