0

I have an interface that I make use of within my application. The interface definition is in a referenced assembly that I created:

// Assembly MyAssembly.dll, v1.0.0.0
public interface IMyInterface
{
    void MyMethod();
}

I make use of this interface within my application (a WPF project) like so:

public class MyClass : IMyInterface
{
    public void MyMethod()
    {
        // Do something...
    }
}

I can right mouse click and select Find Usages on IMyInterface just fine from any implementation of this interface within my project:

OK

However, if I navigate to IMyInterface (Go To Declaration or F12) and open the Metadata view, it doesn't allow me to find usages on either IMyInterface or on any of the method names, the option is greyed out!

Greyed out

This doesn't make sense. It may be from metadata, but I have just navigated from an implementation within my project to the interface definition within the referenced assembly.

Why can't I find usages of the interface name or interface methods and is there any way around it?

Luke
  • 22,826
  • 31
  • 110
  • 193
  • Similar: http://stackoverflow.com/questions/15830659/visual-studio-2010-go-to-implemented-method-rather-than-interface – Robbie Dee Sep 02 '15 at 13:19
  • @RobbieDee I'm not sure that that gives any more info – Luke Sep 02 '15 at 13:22
  • AFAIK you cannot do it from metadata. If you want this option available you need to add this project to your solution. – ehh Sep 02 '15 at 13:22
  • How strange, this is a bit of a down side to creating an assembly out of your code. Especially when it comes to splitting your interfaces out into a separate project, like with a service layer. – Luke Sep 02 '15 at 13:23
  • have you also created and used pdb-files ? – nozzleman Sep 02 '15 at 13:31
  • @nozzleman Good question! I just checked the folder location of the assembly and there is indeed a `.pdb` in there. Do I need to direct VS to that folder in some way? – Luke Sep 02 '15 at 13:33
  • i would check if it is in the output directory of your target solution. not sure if this would solve the issue though – nozzleman Sep 02 '15 at 13:55
  • @Coulton Do you use ReSharper? This would get you going in no time i guess. – nozzleman Sep 02 '15 at 14:09

0 Answers0