Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem using DTE to build a solution

Status
Not open for further replies.

foxjoker

Programmer
Jul 5, 2000
22
US
Hi,
I'm making a web service that automates some test cases. I need to compile a visual studio solution before running executables and I use this part of code to it
Code:
        Dim DTE As EnvDTE.DTE

        Try
            DTE = CType(CreateObject("VisualStudio.DTE.7.1"), EnvDTE.DTE)

        Catch e As Exception

            WriteInLogFile("Cannot create instance of MSDEV " + e.ToString())
        End Try

        Try
            Dim soln As EnvDTE.Solution
            WriteInLogFile("Compilation started")

            soln = DTE.Solution
            If soln.IsOpen() Then
                soln.Close(False)
            End If
            soln.Open(DriveName + ProjectName)
            soln.SolutionBuild.Build(True)
            DTE.Quit()

            WriteInLogFile("Compilation ended")
        Catch e As Exception

            WriteInLogFile("Cannot open or compile project " + e.ToString())
            DTE.Quit()
        End Try

It starts well (I can see the devenv.exe in the task manager), but when it tries to open the solution, it kept blocked, and doesn't throw any exception.

Any idea of how getting out of it ? :'(

txs

foxjoker
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top