ILMerge DLL: Assembly not merged in correctly, still listed as an external reference

前端 未结 5 1668
醉话见心
醉话见心 2020-12-14 05:46

In the build process for a .NET C# tool, I have been using ILMerge to merge the assemblies into a single exe.

I added a new class library recently, and now the ILMe

相关标签:
5条回答
  • 2020-12-14 06:22

    While publishing select 'Do not merge' from configure and than publish the Project

    0 讨论(0)
  • 2020-12-14 06:24

    This is exactly @HughJeffner's answer as an image. It took me a while & some tries to replicate the instructions.

    0 讨论(0)
  • 2020-12-14 06:33

    I got this error and it pointed to the Microsoft.Xrm.Sdk reference which I was merging into the single dll. The problem was fixed when I set another reference, Microsoft.Xrm.Sdk.Deployment to merge into the dll as well. Funny thing is in a separate project I had the 1st reference merging and the 2nd deployment dll not merging & it did not complain at all.

    0 讨论(0)
  • 2020-12-14 06:36

    I got a similar error message when trying to publish a web app that merged all outputs to a single assembly:

    An error occurred when merging assemblies: ILMerge.Merge: The target assembly lists itself as an external reference.

    This happens if the assembly name you are merging to matches the assembly name of the web application under Properties > Application. Changing the output assembly name should fix it.

    0 讨论(0)
  • 2020-12-14 06:41

    I had to use the /closed argument. According to the official docs:

    Closed

    When this is set before calling Merge, then the "transitive closure" of the input assemblies is computed and added to the list of input assemblies. An assembly is considered part of the transitive closure if it is referenced, either directly or indirectly, from one of the originally specified input assemblies and it has an external reference to one of the input assemblies, or one of the assemblies that has such a reference. Complicated, but that is life...

    0 讨论(0)
提交回复
热议问题