In a Visual Studio 2010 project, we had two identically named classes in two different namespaces that are both commonly included in ViewModels throughout the application. One such class has since been deprecated and removed, but I'm getting an ambiguous reference error when directly referring to the remaining class, even though the old class no longer exists.
We basically have something like this:
using OurNamespace.UI.Common;
using OurNamespace.SomewhereElse;
// *snip*
SomeClass.SomeMethod();
Once upon a time, both of the above namespaces had a SomeClass, but we deleted the one in OurNamespace.UI.Common. However, when building, we get the following error:
'SomeClass' is an ambiguous reference between 'OurNamespace.UI.Common.SomeClass' and 'OurNameSpace.SomewhereElse.SomeClass'
I've already tried cleaning the solution and rebuilding as suggested in answers to this ambigous reference question, only to continue to see the error. What's still lurking behind that makes it think the deleted class still exists for purposes of an ambiguous reference? Even IntelliSense knows there's only one now.
If you look at your project's references (via the References
section of the Solution Explorer
window), you can right-click the reference and select View in Object Browser
.
This allows you to investigate the referenced assemblies to see if the offending class is still lurking in any of them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With