ILMerge icon indicating copy to clipboard operation
ILMerge copied to clipboard

Duplicate type and allowDup Option

Open tenneriella opened this issue 4 years ago • 4 comments

Hi all I need to use Graph package in my VS proj but when I compile this error message is outcome "ILMerge.Merge: ERROR!!: Duplicate type 'Microsoft.Graph.UploadSessionRequest' found in assembly 'Microsoft.Graph'. Do you want to use the /allowDup option?" Of course I modified ILMerge.props file setting this value <ILMergeAllowDuplicateType>*</ILMergeAllowDuplicateType>

But I have not solved my problem.

What is wrong ? Maybe this setting? Thanks in advance

tenneriella avatar Jul 09 '20 08:07 tenneriella

If you could post the log that ILMerge writes (when you specify the /log option), then that might help show what is wrong. If that type is public, then the /allowDup option may not help.

mike-barnett avatar Jul 09 '20 18:07 mike-barnett

thanks Mike for your suggestion ,but i don't know how to set the log option because I'm not using command line . I am using MSBuild.ILMerge.Tasks form Visual Studio. So I don't know the corresponding property in ilmerge.props file. As you said, that type is public . What can i use instead of allowDup? Thanks in advance

tenneriella avatar Jul 27 '20 13:07 tenneriella

Sorry, but I don't know anything about the Tasks thing. I would suggest using a command prompt and playing with ILMerge there until you can debug the problem. The /allowDup option should work: if you want it to work for all duplicate types, then you don't need to specify an argument for it. (I'm assuming that's what the asterisk is in your original question.) Have you tried that?

mike-barnett avatar Jul 27 '20 16:07 mike-barnett

Thanks Mike, yes I'm setting the asterisk as first solution. I will follow your suggestion to use the prompt command to debug. Bye

tenneriella avatar Jul 28 '20 09:07 tenneriella