Visual Studio 的 Interop 組件
Visual Studio Interop 組件可讓 managed 應用程式中存取提供 COM 介面Visual Studio擴充性。
Interop 組件中的每個介面對應到Visual Studio的 COM 介面。 每個的設計,讓 managed 程式碼所傳遞的參數資訊近似儘可能相近基礎 COM 物件所需的資訊。 每一種方法會傳回 HRESULT 受管理的應用程式。
Visual Studio Interop 組件完全不一樣管理套件架構類別。 MPF 類別會使用 interop 組件,以提供更高層級的區隔、 更豐富功能集和更強大的互通性和錯誤處理比 interop 組件。
Interop 組件清單
Interop 組件由預設值,在安裝 < Visual Studio SDK 安裝路徑 >\VisualStudioIntegration\Common\Assemblies,而且也安裝到全域組件快取 (GAC)。 下列的 interop 組件所提供的Visual Studio SDK:
Interop 組件名稱 |
功能 |
---|---|
Microsoft.VisualStudio.Debugger.Interop.dll |
提供存取整合式的開發環境 (IDE) 中的偵錯功能。 |
Microsoft.VisualStudio.OLE.Interop.dll |
提供一些標準的 OLE 介面的存取。 |
Microsoft.VisualStudio.Shell.Interop.dll |
提供基本的 IDE 介面的存取。 |
Microsoft.VisualStudio.Shell.Interop.8.0.dll |
提供 IDE 介面、 型別,以及服務的存取。 |
Microsoft.VisualStudio.Shell.Interop.9.0.dll |
提供 IDE 介面、 型別,以及服務的存取。 |
Microsoft.VisualStudio.Shell.Interop.10.0.dd |
提供 IDE 介面、 型別,以及服務的存取。 |
Microsoft.VisualStudio.TextManager.Interop.dll |
提供存取核心編輯器介面。 |
Microsoft.VisualStudio.TextManager.Interop.8.0.dll |
提供核心編輯器介面、 型別,以及服務的存取。 |
Microsoft.VisualStudio.TextManager.Interop.10.0.dll |
提供核心編輯器介面、 型別,以及服務的存取。 |
在一起,這些組件提供下列命名空間:
命名空間 |
內容 |
---|---|
Microsoft.VisualStudio.Shell.Interop VSLangProj |
IDE 及 OLE 介面中使用Visual Studio SDK。 |
Microsoft.VisualStudio.TextManager |
傳統編輯器介面。 |
Microsoft.VisualStudio.Debugger |
支援偵錯環境的介面。 |
Microsoft.VisualStudio.Ole.Interop |
支援 OLE 類型的介面。 |
此外,開發人員可能會發現它有價值,若要使用的成員VSConstants類別,以取得定義通用的常數,如S_OK。
注意事項 |
---|
部分類別,例如VsMethodTipWindowClass類別,都只能以本機登錄已登錄的 COM 類別。您不能建立與這些類別的執行個體new關鍵字。相反地,您必須取得ILocalRegistry物件,並建立這個物件具有CreateInstance方法。MPF 包裝這個方法時CreateInstance。 |