I have several assemblies that merged into one. Here my command.
ilmerge /lib:. /keyfile:../../key.snk /targetplatform:v4 /out:..\..\build\Dynamicalabs.QbIntegration.Plugins.dll .\DynamicaLabs.QbIntegration.Plugins.dll .\Intuit.Ipp.Core.dll .\Intuit.Ipp.Data.dll .\Intuit.Ipp.DataService.dll .\Intuit.Ipp.Exception.dll .\Intuit.Ipp.Security.dll .\Intuit.Ipp.Utility.dll .\Intuit.Ipp.Diagnostics.dll .\Intuit.Ipp.Retry.dll .\Newtonsoft.Json.dll .\DevDefined.OAuth.dll .\DNL.QBIntegration.dll
The problem is with .\Intuit.Ipp.Data.dll assembly. It name is .\Intuit.Ipp.Data.dll, but in file properties Intuit.IPP.Data.dll(capital IPP) . Other assemblies loaded correctly and don't have such thing in description. May this cause this error? And how I edit this? Exception message:
System.IO.FileNotFoundException: Could not load file or assembly 'Intuit.Ipp.Data' or one of its dependencies. The system cannot find the file specified.
=== Pre-bind state information ===
LOG: DisplayName = Intuit.Ipp.Data
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Intuit.Ipp.Data | Domain ID: 1
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
Newtonsoft.Json does not load too. Other assemblies - ok.
Type of exception System.IO.FileNotFoundException
suggest that problem with loading occurs in client code. There is a line that explicitly loads this DLL using e.g. Assembly.LoadFile
. In that case you may have trouble after merging, because there is no longer separate Ipp.Data assembly.
Solution 1: Don't merge Ipp.Data assembly
Solution 2: Find line that causes troubles - e.g. click Debug on app crash, or attach to process - then before merge recompile assembly that loads Ipp.Data fixing assembly name. This can be done by using ildasm
and ilasm
utilities. Tutorial here - http://www.power-programming.co.uk/post/2009/09/23/Using-ildasm-and-ilasm-to-modify-a-NET-assembly.aspx