Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve incorrect "Ambiguous reference" from ReSharper on class inheritance?

Tags:

resharper

In my project I have a class that is inherited by many other classes. We'll call it ClassBase.

public class ClassInheritFromBase : ClassBase 

When ClassBase is being inherited, ReSharper throws an "Ambiguous reference" warning on the ClassBase, and anything inside the new class that inherited from ClassBase does not have IntelliSense and gets warnings that it cannot find it.

The project compiles and runs fine.

If I change the namespace ClassBase is in and then change the inheriting classes, they find it fine and ReSharper has no problem, IntelliSense works ... until it is compiled. After the compile it goes back to having the ambiguous reference warnings and everything else.

Has this been seen before and how can it be fixed? I saw an entry in JetBrains bug tracking for an issue just like this, but they closed it as unable to reproduce.

like image 291
Carlton Jenke Avatar asked Oct 10 '08 15:10

Carlton Jenke


1 Answers

For those who still have a problem with this, (I still get it from time to time) here's the steps I did to get rid of the ambiguous reference warning in ReSharper.

  1. First I went to all my class libraries and made sure that all references to my other class libraries had the Copy Local property set to false.
  2. In the project where I actually got the ambiguous reference warning, I went to my bin catalog and deleted all .dll and .pdb files for all the libraries that had their own project.
  3. After a new build, or in my case "update reference" on the .dll files in VS, the errors from Resharper were gone.

I'm using Resharper 5.1 in Visual Studio 2008 with only a reference to the dlls I'm using which is why I had to "update reference"

like image 85
MortenRøgenes Avatar answered Sep 23 '22 17:09

MortenRøgenes