Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
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.
For some reason MD is internally handling the "AnyCPU" platform as "", and it wasn't mapping it back when invoking msbuild. Fixed in git.