ILMerge:在多个程序集中定义的预定义类型

时间:2013-12-03 16:29:15

标签: c# dll assemblies ilmerge

我的Visual Studio解决方案中有3个C#项目:

project1:.NET4中的类库

project2:.NET4中的类库,带有Microsoft.Bcl.Asyn NuGet包。

projectFinal:.NET5中的控制台应用程序

project3引用project2project2引用project1。我不想隐藏project1.dllproject3

所以我启动了ILMerge命令:

ILMerge /target:libray project2.dll  project1.dll  /out:project12.dll  /internalize /lib:C:\Windows\Microsoft.NET\Framework64\v4.0.30319

编译和合并没问题,我可以在project12.dll中引用project3。但我有很多警告:

The predefined type 'System.Action' is defined in multiple assemblies in the global alias; using definition from 'project12.dll'

The predefined type 'System.Func' is defined in multiple assemblies in the global alias; using definition from 'project12.dll'

如何在编译/合并期间解决我的问题?

0 个答案:

没有答案