开发者

how to get visual c# express application instance

开发者 https://www.devze.com 2023-02-16 23:12 出处:网络
I am using visual c# express edition and i 开发者_如何学JAVAwant to create that application instance to get output window object.So i have used below code for creating visual studio instance.

I am using visual c# express edition and i 开发者_如何学JAVAwant to create that application instance to get output window object.So i have used below code for creating visual studio instance.

DTE2 dte = (DTE2)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.10.0");

but this is giving exeception :

Invalid class string (Exception from HRESULT: 0x800401F3 (CO_E_CLASSSTRING))

so please help me out.


For Visual Studio 2013 Express, then the following works:

DTE2 dte = (DTE2)System.Runtime.InteropServices.Marshal.GetActiveObject("WDExpress.DTE.12.0");

In more generality, you can search for all running objects using the approach in Get current visual studio instance (EnvDTE) in C#

0

精彩评论

暂无评论...
验证码 换一张
取 消