简体   繁体   中英

how to combine 3rd party dll with own dll

I'm creating a library TRSetup.dll in C#. The project include some third party dll. (eg: GalaSoft.MvvmLight.Extras.WPF4.dll, GalaSoft.MvvmLight.WPF4.dll, RemObjects.Hydra.dll)

I need to combine all the dll and create a single dll.

I'm using ilMerge to combine the dll. The following command I'm using,

    ilMerge /out:MergedSetup.dll /targetplatform:v4,"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client" 
/lib: TRSetup.dll  Galasoft.MvvmLight.Extras.WPF4.dll Galasoft.MvvmLight.WPF4.dll RemObject.Hydra.dll

I can create a dll with the name MergedSetup.dll, But in runtime it is crashing. How shall I merge these dll.

Thank you in advance.

That's know problem with WPF (and NHibernate, and many others which reference assembly by name) and ILMerge. Long story short after ILMerge there is no such assembly anymore, they all get injected into main assembly.

Try embedding instead of merging: LibZ ( http://libz.codeplex.com/ ) or Costura.Fody ( https://github.com/Fody/Costura/ )

Disclaimer: I'm the author of LibZ.

Cheers,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM