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.

Comments

blog comments powered by Disqus
Next Post
Regions in C#  16 May 2011
Prior Post
Reconsidering the Repository Pattern  09 May 2011
Related Posts
Using Constructors  27 Feb 2023
An Inconvenient API  18 Feb 2023
Method Archetypes  11 Sep 2022
A bash puzzle, solved  02 Jul 2022
A bash puzzle  25 Jun 2022
Improve your troubleshooting by aggregating errors  11 Jun 2022
Improve your troubleshooting by wrapping errors  28 May 2022
Keep your promises  14 May 2022
When are you done?  18 Apr 2022
Fixing GitHub Authentication  28 Nov 2021
Archives
May 2011
2011