The type exists in both DLLs

泄露秘密 提交于 2020-01-03 11:33:13

问题


I wanted to use something from Accord library as well as the AForge library. But when I installed it, I started getting the following error:

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'

On this line of code:

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

How can I ensure that I only use the original AForge DLL for this? Is there perhaps a workaround?

I tried

AForge.IntPoint

but as it turns out, Accord uses the same namespace...!


回答1:


Open up your project's References, right-click on the offender, and select Properties.

Change your Aliases to a custom name:

Then whenever you wish to use your offending reference in your code, simply insert this at the top of your file:

extern alias MyAlias;



回答2:


I fixed this by checking Delete all existing files prior to publish



来源:https://stackoverflow.com/questions/36805570/the-type-exists-in-both-dlls

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!