2013-04-18 45 views
-1
The type or namespace name 'Server' could not be found (are you missing a 
using directive or an assembly reference?) 

什麼是要添加的命名空間或組件對付這個error.Similar引發錯誤時我正在使用ServerConnection類。類型或命名空間名稱「服務器」找不到(是否缺少using指令或程序集引用?)

+0

那麼你有沒有在您的項目'Microsoft.SqlServer.ConnectionInfo.dll'(這些類居住的組裝)的參考? – Arran

+0

'通過右鍵單擊項目中的'Reference'來添加Reference。 – RajeshKdev

回答

3

您應該參考以下裝配

命名空間:在Microsoft.SqlServer.ConnectionInfo.dll Microsoft.SqlServer.ConnectionInfo(:Microsoft.SqlServer.Management.Common

大會

Find more here

0

找到發生此錯誤的源文件。它可能會包含using語句命名空間,像

//make sure this dll is copied to the deployment machine 
using Foo.Server; // <===== 

namespace MyProject 
{ 
    public class Bar { } 
} 
  • 檢查到特定庫的引用添加到項目
  • 確保它/箱引用,而是使用一個/lib目錄文件夾或GAC
  • 檢查庫的屬性,並將其設置複製本地真正
相關問題