It’s been a while since my last post; I had several major lifestyle changes a few months back, not least starting a family, so my priorities have been elsewhere. Anyway, hopefully I can get the post frequency up a bit now.
The other day I encountered an odd issue when trying to build a solution. I was getting the error:
MSB4126: The specified solution configuration “Release|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.
I had no idea what BNB was and where it had come from – it seemed like the build engine was picking it up as the platform somehow. But there was no reference to it anywhere in the solution, nor in the build script. I recalled having seen this on another project a while back; I can’t remember the exact circumstances, I worked round it somehow in the end, but it suggested that it wasn’t something specific to this solution.
I was baffled by this for a while and was struggling to find any clues on Google, until eventually I discovered that my laptop had come with an environment variable of “Platform” defined with a value of, you guessed it, “BNB”. Turns out that this was getting picked up by the build script and being set as the Platform property, so instead of it being blank as the error message suggested, it was resulting in a non-sensical solution configuration.
Further digging revealed that this environment variable is specific to certain HP machines and the software they typically ship with, so not too widespread which is why it turned out to be difficult to search for.
The simple solution was to just delete the environment variable; the build ran fine afterwards. Got no idea what purpose it served but the machine hasn’t thrown any wobblies since 🙂