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
Next Post
Regions in C#  16 May 2011
Prior Post
Reconsidering the Repository Pattern  09 May 2011
Related Posts
Types behaving badly  14 Apr 2018
Implementing Value Equality  07 Apr 2018
Implementing Entity Equality  31 Mar 2018
Equality and GetHashCode  24 Mar 2018
Types of Equality  10 Mar 2018
Why is Equality important in .NET?  03 Mar 2018
Intersect and Except  24 Jul 2008
Streams in .NET  26 Dec 2003
Bitmap cloning in .NET  11 Dec 2003
Streams in .NET  20 Nov 2003
May 2011