【发布时间】:2012-04-08 03:56:59
【问题描述】:
借助 Visual Studio 调用层次结构功能,我可以找到对某个方法的调用。
但是,它似乎无法通过已实现的接口找到类。如下所示,如果通过 IFoo 调用 Method(),那么在 Call Hierarchy 中找不到这些调用?
interface IFoo
{
void Method();
}
class Foo : IFoo
{
public void Method()
{
// ...
}
}
有没有办法在普通的 VS 中或使用一些免费插件来做到这一点?
Resharper 似乎能够做到这一点(在更复杂的情况下存在一些问题),如 C# - Can't find usage of method when inherited and used through an interface implemented by the subclass。
br,图子
【问题讨论】:
-
在提供的代码中,该类没有实现接口。这是一个错误吗?
标签: c# visual-studio-2010 code-navigation call-hierarchy