vb.net compile error 'abc' is ambiguous in the namespace 'xyz'

Gern Blanston picture Gern Blanston · Jan 7, 2010 · Viewed 22.2k times · Source

I have a VB.Net solution that another developer created and I'm trying to compile it on our build machine (it compiles on their machine) but with one of the projects I get an error saying something along the lines of:

Imyinterface is ambiguous in the namespace anamespaceassembly.

I have tried with no success:

  • examined the references to see any obvious errors
  • removed and re-added the assembly in question
  • searched the system for the same dll
  • attempted to compile the original deve's src (.v the source control version)
  • examined the assembly with ildasm.exe

I usually code in C# and have not seen this error before (in this form at least), not that it is VB.Net specific but the UI for adding/viewing references is slightly different so I thought maybe VB.Net might do something different with references.

I also tried to compile on another machine, and it compiles ok. So I assume it is something with the build machine but I'm not sure what. Other conflicting assemblies somehow not referenced by the project, is that possible??

Any ideas?

Answer

desolit picture desolit · Nov 19, 2013

Check your references if you have two versions of the same reference (eg. Microsoft.ReportViewer.Webforms version 10.0.0.0 and Microsoft.ReportViewer.Webforms 8.0.0.0) You will get this error. Delete the oldest and you should be good. I do this to myself all of the time.