I'm trying something exploratory:
Say I have a library "coolproject" and it has dependencies to one.dll
, two.dll
, and three.dll
.
I would like to use ILMerge to combine coolproject with one.dll
and two.dll
but NOT three.dll
. At the completion of the merge I should have coolproject.dll
and three.dll
. Wherever I intend to use coolproject.dll
I must also reference three.dll
Is this even possible? Whenever I try it I get. Unresolved assembly reference not allowed: three
. I'm omitting three.dll
by setting "Copy Local" = false.
[EDIT]:
Executed as the following:
ILMerge /targetplatform:v2 /log /internalize /out:bin\coolproject.dll obj\Debug\coolproject.dll C:\Users\Nick\Projects\test\bin\one.dll C:\Users\Nick\Projects\test\bin\two.dll
The reason this does not work ended up being rather simple: ILMerge must be able to locate the dll that you have omitted from the list.
When evaluating dependencies in the target library, ILMerge by default checks various locations to identify the dependent library (\bin, GAC, etc) even if you omitted it from the command line list. If it cannot locate this library you must specify its location using the \lib
switch. Otherwise you will see the Unresolved assembly reference not allowed: three
error.
Example:
ILMerge /lib:..\three\bin\three.dll /targetplatform:v2 /log /internalize /out:bin\coolproject.dll obj\Debug\coolproject.dll C:\Users\Nick\Projects\test\bin\one.dll C:\Users\Nick\Projects\test\bin\two.dll
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With