开发者

how to get visual c# express application 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜