Build project using devenv.exe in TFS 15RC1 Build Server

大兔子大兔子 提交于 2021-01-29 03:14:31

问题


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).


回答1:


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:

  • "Visual Studio Build" build step that actually invokes devenv.com instead of msbuild?
  • visual studio command-line build vnext step (devenv.com)

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




回答2:


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.




回答3:


$argumentList = ("`"$solnPath`" /$solnCmdSwitch $solnConfigName")

if project then add folowing

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

See the extra back-quotes



来源:https://stackoverflow.com/questions/38957012/build-project-using-devenv-exe-in-tfs-15rc1-build-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!