该类型存在于两个DLL中

时间:2016-04-23 01:26:05

标签: .net dll nuget aforge accord.net

我想使用Accord库和AForge库中的东西。但是当我安装它时,我开始收到以下错误:

Error CS0433
The type 'IntPoint' exists in both
    'AForge, Version=2.2.5.0, Culture=neutral, PublicKeyToken=c1db6ff4eaa06aeb' and
    'Accord, Version=3.0.2.0, Culture=neutral, PublicKeyToken=fa1a88e29555ccf7'

在这行代码中:

startingPoint = new IntPoint(point.X, point.Y);

如何确保我只使用原始的AForge DLL?可能有一种解决方法吗?

我试过

AForge.IntPoint

但事实证明,Accord使用相同的命名空间......!

2 个答案:

答案 0 :(得分:6)

打开项目References,右键点击违规者,然后选择属性。

enter image description here

将别名更改为自定义名称:

enter image description here

然后,只要您希望在代码中使用违规引用,只需将其插入文件顶部即可:

extern alias MyAlias;

答案 1 :(得分:0)

我通过检查Delete all existing files prior to publish来解决此问题 enter image description here