Search code examples
visual-studio-2015jenkins-pipelinedevenv

VS2015 devenv build runs asnc?


Trying to create a Jenkins pipeline to run devenv to build SSIS projects. It appears that devenv returns immediately while the build runs in the background. I've done this previously with VS2010 and as far as I can remember devenv didn't return to the console until the build completed.

I'm running: devenv mysolution.sln /build "debug|Any Cpu". The command prompt returns immediately. There's no build output in the project's bin or obj folders. If I simply watch the folders the build output eventually (a few seconds) shows up.

Is there any way to ensure devenv doesn't return until all the work is complete? I've tried all the options that seem to be relevant from the command line help. Not much on Google or SO seems relevant.

Any thoughts?


Solution

  • Option 1: msbuild

    Probaby, by far the easiest would've been to use msbuild. SSIS is supported like outlined in this SO answer

    msbuild /t:Build /p:Configuration=Debug your_solution.sln
    

    this however, wasn't an option for you, therefore

    Option 2: spawn process and wait till devenv finishes

    one opiton to do it in Powershell is Get-Process as outlined in this SO answer

    to capture outputs you might opt for /out or/and /log like so:

    devenv.exe your_solution.sln /build "debug|any cpu" /out "c:\buildlog.txt"
    

    Upd this part of documentation seems to explain the difference between different devenv flavours:

    Commands that begin with devenv are handled by the devenv.com utility, which delivers output through standard system streams, such as stdout and stderr. The utility determines the appropriate I/O redirection when it captures output, for example to a .txt file.

    Alternatively, commands that begin with devenv.exe can use the same switches, but the devenv.com utility is bypassed. Using devenv.exe directly prevents output from appearing on the console.