Is it possible to only merge a subset of dependencies using ILMerge?

后端 未结 3 2136
广开言路
广开言路 2021-01-04 10:28

I\'m trying something exploratory:

Say I have a library \"coolproject\" and it has dependencies to one.dll, two.dll, and three.dll

3条回答
  •  独厮守ぢ
    2021-01-04 11:03

    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
    

提交回复
热议问题