Visual Studio 2008 Macro for Building does not block thread

Posted by Climber104 on Stack Overflow See other posts from Stack Overflow or by Climber104
Published on 2009-10-06T15:22:35Z Indexed on 2010/05/01 7:07 UTC
Read the original article Hit count: 269

Hello,

I am trying to write a macro for Building my application, kicking off an external tool, and ataching the debugger to that external tool.

Everything is working except for the building. It builds, but it is not blocking the thread so the external tool gets kicked off before it can finish. Is there a way I can run ExecuteCommand and wait for the thread to finish?

Code is below:

    DTE.ExecuteCommand("ClassViewContextMenus.ClassViewProject.Build")
    DTE.ExecuteCommand("Tools.ExternalCommand11")

    Try
        Dim dbg2 As EnvDTE80.Debugger2 = DTE.Debugger
        Dim trans As EnvDTE80.Transport = dbg2.Transports.Item("Default")
        Dim dbgeng(1) As EnvDTE80.Engine
        dbgeng(0) = trans.Engines.Item("Managed")
        Dim proc2 As EnvDTE80.Process2 = dbg2.GetProcesses(trans, "MINIPC").Item("_nStep.exe")
        proc2.Attach2(dbgeng)
    Catch ex As System.Exception
        MsgBox(ex.Message)
    End Try

© Stack Overflow or respective owner

Related posts about visual-studio-2008

Related posts about visual-studio