emerbrito / ILMerge-MSBuild-Task

Adds ILMerge to Visual Studio 2013/2017 or automated builds. This Task is intended to work right out of the box however, it supports a configuration file where you can control every ILMerge property including the list of assemblies to be merged.
MIT License
54 stars 15 forks source link

ILMergeAllowDuplicateType doesn't seem to be working #29

Closed mnwachukwu closed 5 years ago

mnwachukwu commented 5 years ago

I am using the ILMerge.props file to try and allow duplicate types in my merged assembly. I have set this value in the file to true like so

<ILMergeAllowDuplicateType>true</ILMergeAllowDuplicateType>

But that didn't do anything. I've also added an ILMergeConfig,json file and set the AllowDuplicateType property in the Advanced object to true like so

"AllowDuplicateType": true

Yet I'm still seeing this issue:

ILMerge.Merge: ERROR!!: Duplicate type 'Newtonsoft.Json.ConstructorHandling' found in assembly 'Newtonsoft.Json'. Do you want to use the /alllowDup option?

Am I missing something?

mnwachukwu commented 5 years ago

Turns out I needed to specify a value of * rather than true... This was not made clear in any documentation. I had to search the repository code files to find out, so I'm answering this here so anyone else who is wondering will know.

I am not aware of any other documentation that may have specified this. I searched for days before I thought to do a code search.

Here it is in it's full context: <ILMergeAllowDuplicateType>*</ILMergeAllowDuplicateType>