1

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 ?

Apaachee
  • 900
  • 2
  • 10
  • 32
  • Have you tried the /allowDup argument to ILMerge? – Luaan Dec 03 '13 at 16:32
  • That's [pretty doubtful](http://stackoverflow.com/questions/13748055/could-not-load-type-system-runtime-compilerservices-extensionattribute-from-as/13750130#13750130). .NET 5??? – Hans Passant Dec 03 '13 at 17:26
  • That was .NET4.5 sorry – Apaachee Dec 04 '13 at 08:52
  • But when I use ILMerge with AllowDup, I have the error : Additional information: Could not load type 'ProgressHandler' from assembly 'A.B.C, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' because the method 'func' has no implementation (no RVA). – Apaachee Dec 05 '13 at 16:20

0 Answers0