While upgrading the NAntGraph solution to .Net 4, my build script started failing with an inexplicable error:

C:\Projects\NAntGraph\NAntGraph2.sln.metaproj : error MSB4126: The specified solution configuration “Debug|BNB” is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform=”Any CPU”) or leave those properties blank to use the default solution configuration.

Searching my solution and project files for “BNB” turned up no results at all, leaving me at a loss.

To cut a long story short, it turns out that my HP ProBook has a PLATFORM environment variable set to “BNB”.

While no doubt put into place for reasons unrelated to .Net development, the PLATFORM environment variable is picked up by MSBuild as the default for compilation, leading to the slightly bizarre error above.

Lesson of the day: Be explicit on configuration and platform choice when invoking MSBuild.


blog comments powered by Disqus