編譯器錯誤 CS0234
更新:2007 年 11 月
錯誤訊息
命名空間 'namespace' 中沒有型別或命名空間名稱 'name' (您是否遺漏了組件參考?)
必須是一種型別。可能的原因包括:
編譯時沒有參考包含型別定義的組件 (Assembly);請使用 /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();
}
}