I have 3 C# projects in my Visual Studio solution :
project1
: Class library in .NET4
project2
: Class library in .NET4 with Microsoft.Bcl.Asyn NuGet package.
projectFinal
: Console application in .NET5
The project3
references project2
and project2
references project1
. I wan't to hide the project1.dll
to project3
.
So I launch the ILMerge command :
ILMerge /target:libray project2.dll project1.dll /out:project12.dll /internalize /lib:C:\Windows\Microsoft.NET\Framework64\v4.0.30319
Compilation and merge are OK, I can reference project12.dll
in my project3
. But I have lots of warning :
The predefined type 'System.Action' is defined in multiple assemblies in the global alias; using definition from 'project12.dll'
or
The predefined type 'System.Func' is defined in multiple assemblies in the global alias; using definition from 'project12.dll'
How can I resolve my problem during compilation/merge ?