dotnet / ILMerge

ILMerge is a static linker for .NET Assemblies.
MIT License
1.22k stars 168 forks source link

Duplicate type and allowDup Option #87

Open tenneriella opened 4 years ago

tenneriella commented 4 years ago

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 *

But I have not solved my problem.

What is wrong ? Maybe this setting? Thanks in advance

mike-barnett commented 4 years ago

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.

tenneriella commented 3 years ago

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

mike-barnett commented 3 years ago

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?

tenneriella commented 3 years ago

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