How can I reference an environment variable in TFS build configuration?

时间:2018-03-09 19:02:01

标签: tfs

I have set an environment variable on my system named MSBUILD_HOME that points to the directory that contains the msbuild.exe.

I want to reference this environment variable in the TFS build configuration. Specifically, I want to reference it in the Build->Advanced->Path to MSBUILD field of an MSBuild configuration step.

I have tried: MSBUILD_HOME, $(MSBUILD_HOME), %MSBUILD_HOME% but nothing works and I've Googled this to death. What am I missing?

1 个答案:

答案 0 :(得分:0)

Doh! I just needed to restart the build agent to pick up the changes to the environment. Using $(MSBUILD_HOME) was the right way to reference it.