Visual Studio 2008 and 2008 SP1 Addin: Using EnvDTE90 and EnvDTE90a

Does anyone know the equivalent for this in Visual Studio 2008 ( EnvDTE90 ) and Visual Studio 2008 SP1 ( EnvDTE90a )?

    //this is code for Visual Studio 2005, works great
    EnvDTE80.DTE2 dte2 = (EnvDTE80.DTE2)System.Runtime.InteropServices.Marshal.
    GetActiveObject("VisualStudio.DTE.8.0");

    foreach (EnvDTE80.Breakpoint2 bp in dte2.Debugger.Breakpoints)
    {
         //do some things
    }

      

I did normal google searches and found different things, but none of them worked.

EnvDTE90.Debugger3 only works when debugging is active. Do I want to access breakpoints anytime?

NOTE. Please do not post links to existing code examples that MUST work. I've tried everything I can find.

+1


a source to share


2 answers


Finally I got the code. KristoferA's answer is partially correct in that the same API can be used, but the code won't work verbatim. This is how I got it working:



EnvDTE80.DTE2 dte2 = (EnvDTE80.DTE2)System.Runtime.InteropServices.Marshal.
GetActiveObject("VisualStudio.DTE.9.0");

foreach (EnvDTE80.Breakpoint2 bp in dte2.Debugger.Breakpoints)
{
     //do some things
}

      

0


a source


VS2005 code (EnvDTE80) should work fine with VS2008. EnvDTE90 is just adding some new features, but EnvDTE80 and EnvDTE are still essential for the basics.



+3


a source







All Articles