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 🙂
9 Comments
Thanks for the post!
Indeed, I have an HP computer here and the same issue occured. Now solved, thanks again
Thankssssssssssssss
thx, in my case Platform’s value was MCD… I’m also on a hp laptop.
Hi,
This had me scratching my head for a while trying to build Orchard from the command line.
Thanks for the article…very helpful!
Sam
Thanks for this post – it had me scratching my head for a good while!
Also have a HP laptop. HP laptops have software preinstalled that doesn’t do anything useful. Thanks for the solution!
Nice. Worked for me too. Thanks!
Thanks, I have also scratched my head in too and solution worked for me.
Should I say You are a STAR 🙂 , it may look simple, but the hard part of finding and posting it online 🙂