maxadamcamb
maxadamcamb

Reputation: 333

How to restart debug session programmatically in Visual Studio 2013 EXPRESS

I want to restart Debugging session programmatically in Visual Studio "2013 Express".

I saw some examples that can do it with EnvDTE but they are only supporting VS2010 and previous versions.

I have tried following code with different version of DTE Interface.

DTE2 myDTE = (DTE2)Marshal.GetActiveObject("VisualStudio.DTE.9.0");
myDTE.ExecuteCommand("Debug.Start"); // or Debug.StartWithoutDebugging

Is there any limitation for Visual Studio 2013 Express?

Thanks. Murat.

Upvotes: 0

Views: 644

Answers (1)

maxadamcamb
maxadamcamb

Reputation: 333

I found the solution.

GetActiveObject() should be called for Visual Studio 2013 Express ("WDExpress.DTE.12.0")

So, correct flow is ;

DTE2 myDTE = (DTE2)Marshal.GetActiveObject("WDExpress.DTE.12.0");
myDTE.ExecuteCommand("Debug.Start"); // or Debug.StartWithoutDebugging

Thanks.

Upvotes: 1

Related Questions