Friday, February 6, 2015

Using the C:\Program Files (x86) directory in MSBuild projects

In prior versions of MSBuild, it was always difficult to properly obtain the path to the C:\Program Files (x86) directory without either hard-coding it into the application or writing some conditional statements to correctly determine the proper Program Files directory on the system depending on whether you were running MSBuild on a 32-bit or a 64-bit OS.

Well, fortunately, with the release of MSBuild v. 4.0, this property is now a Reserved property, though it is not well known called MSBuildProgramFiles32.

Here is a list of all of the new MSBuild Properties that were released with MSBuild v. 4.0: http://sedodream.com/2010/03/11/MSBuild40ReservedProperties.aspx
http://devonenote.com/2011/04/msbuild-reserved-properties/

For the complete listing of the Well Known and Reserved MSBuild Properties, you can check out the MSDN documentation here: https://msdn.microsoft.com/en-us/library/ms164309.aspx

No comments:

Post a Comment