类型';Expando';在未被引用的程序集中定义

本文关键字:程序 程序集 定义 集中 Expando 类型 引用 | 更新日期: 2023-09-27 18:20:25

我得到以下编译错误:

The type 'Expando' is defined in an assembly that is not referenced. 
You must add a reference to assembly 'Westwind.Utilities, Version=2.64.0.0, 
Culture=neutral, PublicKeyToken=6f7d66a3bb7de652'.  

问题是,我引用了程序集的那个版本。。。我认为问题出在类库上。

我的ClassLibrary有以下类:

public class Generic_AnswerFile : Expando { ... }

我的测试控制台有以下类:

public class Specific_AnswerFile : Generic_AnswerFile { ... }

Specific_AnswerFile将不会编译。有什么想法吗?这两个项目都是.Net 4.0,并引用了正确的.Net 4.0版本的Westwind.Utilities 2.64

类型';Expando';在未被引用的程序集中定义

Expando类型在他的程序集中定义

这意味着只有在GAC中。尽管你有参考……但它将无法加载。要正确加载它,您需要在配置文件中的装配标签下定义它

<add assembly="Expando, Version=1.0.0.0, Culture=neutral, PublicKeyToken=[MyPublicKeyToken]"/>