编译器错误 CS0234
更新:2007 年 11 月
错误消息
命名空间“namespace”中不存在类型或命名空间名称“name”(是否缺少程序集引用?)
应为某个类型。可能的原因包括:
在编译中未引用包含某个类型定义的程序集。请使用 /reference(导入元数据)指定程序集。
将某个变量名传递给了 typeof 运算符。
有关如何在开发环境中添加引用的信息,请参见“添加引用”对话框。
下面的示例生成 CS0234:
// CS0234.cs
public class C
{
public static void Main()
{
System.DateTime x = new System.DateTim(); // CS0234
// try the following line instead
// System.DateTime x = new System.DateTime();
}
}