1

I have a trouble with understanding how to use devenv.exe from TFS Build Server.

There is no default step to use devenv, so I tried to use PowerShell sсript to execute devenv.exe with parameters. There are no errors in build process but I see that build result files are not updated. If I execute the script manually on a agent-machine, the build passes successfully. That is my script:

$process = [System.Diagnostics.Process]::Start( "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe", "/Rebuild ""MyConfig"" ""C:\agent\agent\_work\1\s\MyProject.sln"" /Project ""C:\agent\agent\_work\1\s\MyProject\MyProject.dwproj""") 
$process.WaitForExit()

As you see now I do not use variables for source paths, but I will use it if script will work.

I also have to say that I could not find any logs with errors. Maybe I do not know where to find them?

So,

  1. What am I doing wrong in powershell script?
  2. What is the best practice to build project using devenv.exe in TFS Build Server?

PS We are using TFS 15 RC1 (Version 15.103.25603.0).

Nick
  • 105
  • 2
  • 11

3 Answers3

0

For now, there is no this build-in feature to support directly using devenv.exe in vNext build task. But seems will coming in the near future:

That is not something we are working on right now, but it is something that we would take a pull request for.

chrisrpatterson commented on Jan 8

We want an input on the existing Visual Studio Build task that says use devenv (defaults to false). If true, it takes the variant path running code similar to above.

bryanmacfarlane commented on Jan 22

Source from GitHUB:

You can try to use a pull request provide by jmacnett which creating a customize build task.

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • Thanks for your answer. Ok, directly devenv is not supported. But I tried to use Powershell task and Batch task for running devenv.exe. As far as I can see the devenv is started and is doing something, but the files in the bin folder are not updated... – Nick Aug 18 '16 at 13:18
  • Can you try to add a Copy task target the /bin folder when looking for the DLL files? Something as manually copy to workaround the issue? – PatrickLu-MSFT Aug 19 '16 at 10:09
0

I found that it doesn't work only when the agent is running as a service. When I started the agent in the interactive mode, my tasks started to work correctly. Why? - I don't know.

Nick
  • 105
  • 2
  • 11
0
$argumentList = ("`"$solnPath`" /$solnCmdSwitch $solnConfigName")

if project then add folowing

$argumentList += (" /project `"$projPath`" /projectconfig $projConfigName")

See the extra back-quotes

Peter
  • 148
  • 1
  • 8