Bug 2226 - Platform value in MSBuild is not the same as VS
Summary: Platform value in MSBuild is not the same as VS
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Project Model ()
Version: Trunk
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Mikayla Hutchinson [MSFT]
Depends on:
Reported: 2011-11-28 12:05 UTC by Mikayla Hutchinson [MSFT]
Modified: 2011-12-02 11:28 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Mikayla Hutchinson [MSFT] 2011-11-28 12:05:06 UTC
The Platform value in the MSBuild engine isn't the same as that when invoked from within VS, as indicated by this bug:

1) some HP tool sets the global "Platform" env var to some value for its own internal use
2) When MSBuild targets are invoked from commandline MSBuild (without explicitly passing platform value) or from Expression Blend or MonoDevelop, MSBuild takes the value from the Platform env var
3) Because MSBuild found a value, it doesn't use the built-in default "AnyCPU" value 
4) When the MS common targets validate the Platform value using the bad HP value, they fail.

I'm not sure whether this is because MD needs to pass a value to MSBuild or whether it's because it needs to clear the environment. From the list of env vars printed when in diagnostic log level, I assume it's the former.

This only seems to cause a problem on certain (arguably broken) environments.
Comment 1 Mikayla Hutchinson [MSFT] 2011-12-02 11:28:07 UTC
For some reason MD is internally handling the "AnyCPU" platform as "", and it wasn't mapping it back when invoking msbuild. Fixed in git.