C# 当加载项类尝试访问,但方法确实存在于最新引用的dll中时,MissingMethodException

C# 当加载项类尝试访问,但方法确实存在于最新引用的dll中时,MissingMethodException,c#,add-in,methodnotfound,C#,Add In,Methodnotfound,假设我将类作为执行代码的一部分: public class DataAccess { //class definition... } 我有一个外接程序类: public class Tender { public DataAccess DataAccess { get; set; } //other members and class definition } 我的问题是我有一个消费类(也是外接程序),如下所示: public class TenderProcesso

假设我将类作为执行代码的一部分:

public class DataAccess
{
    //class definition...
}
我有一个外接程序类:

public class Tender
{
    public DataAccess DataAccess { get; set; }
    //other members and class definition
}
我的问题是我有一个消费类(也是外接程序),如下所示:

public class TenderProcessor
{
    public void Process(Tender tender)
    {
        //having line below uncommented throws the following exception when 
        //this(Process) method is called: 
        //Method not found: 'namespace.DataAccess namespace.Tender.get_DataAccess()'

        this.DoSomething(tender.DataAccess, otherParametersEtc);    
    }
}
如果
this.DoSomething(tender.DataAccess,otherParametersEtc)
没有注释,我会得到
方法找不到异常
,但是如果我注释掉这行,我实际上可以进入Process方法,将鼠标悬停在
tender
对象上,看到
DataAccess
的值


有人能解释一下发生了什么吗?

请检查您是否引用了包含
Tender
的程序集的数据版本是的,两个加载项项目与DataAccess类位于同一个解决方案中,我直接引用的是项目,而不是DLLDL Hell,这是“加载项”的标准问题。使用Fuslogvw.exe进行故障排除,记录所有绑定。也可能是二进制文件已添加到GAC。我支持@HansPassant使用Fuslogvw之类的工具来查看实际加载的内容,尽管使用该窗口可能更容易,因为您提到您正在调试。