M
M
Maxim Nikitin2015-11-11 14:21:29
.NET
Maxim Nikitin, 2015-11-11 14:21:29

Why doesn't TFS build substitute the value of the $(VSInstallDir) macro?

There is a rather interesting problem, which by no means can be solved. We have a build-machine where builds are assembled. I recently made changes to run the editbin.exe utility with the LARGEADDRESSAWARE parameter at the end of each build, which is located in the C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin folder (it is clear that the path to the folder may change). In the build project, I added a new target:

<Exec command="&quot;$(VSInstallDir)\VC\bin\editbin.exe&quot; /LARGEADDRESSAWARE &quot;Manager.exe&quot;"/>

If you run MSBuild locally with this target on the same machine, then everything works. Good! But when checking in and trying to build, the build fails with the following error:
The command ""\VC\bin\editbin.exe"" exited with code 3.
As you can see, TFS build did not substitute the $(VSInstallDir) value of the macro. How to treat?
UPD:
I found out that there is such a wonderful file on the build machine: C:/Program Files/MSBuild/Microsoft/VisualStudio/TeamBuild/Microsoft.TeamFoundation.Build.targets
It has a definition
<VSINSTALLDIR Condition="'$(VSINSTALLDIR)'=='' and '$(NetSamplePath)'!=''">$(NetSamplePath)\..\..<VSINSTALLDIR>

so that's how I understand $(NetSamplePath) is empty for some reason. Google knows almost nothing about this macro.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Makarov, 2015-11-11
@MaxSter

In the properties of the buildplan, you can specify additional arguments to be passed to MSBuild when starting the build.
With the help of arguments, you can set the values ​​of MSBuild-properties in the following way:
I think it will be possible to set VSInstallDir as well. Perhaps the value of this property is pulled from environment variables, but they are not set on the buildserver.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question