I have a 32bit build agent on which our MSBuilds run. We recently added a new 64bit machine to our build agent array, but some things in our TFSBuild.proj file is hard coded for a 32bit machine.
Is it possible to check whether the environment being built on is 32 or 64bit?
<Exec Command=""C:\Program Files\Microsoft Visua开发者_开发知识库l Studio 10.0\Common7\IDE\devenv.exe" "$(BuildDirectoryPath)\FooProduct/foo.vdproj" /Build "Release""/>
When running the build on a 32bit machine, it must point to C:\Program Files\... but on a 64bit machine, it must point to C:\Program Files (x86)\...
Thanks
There is $(MSBuildProgramFiles32)
property in MSBuild 4.0.
More details at MSBuild Reserved Properties.
The MSBuild subfolder under the \Program Files\ or \Program Files (x86) folder. This path always points to the 32-bit Program Files folder. For example, on a 32-bit machine, the path is to the Program Files folder. For a 64-bit machine, the path is to the Program Files (x86) folder.
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
DefaultTargets="Test"
ToolsVersion="4.0">
<Target Name="Test">
<Message Text=""$(MSBuildProgramFiles32)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" />
</Target>
</Project>
精彩评论