Release|BNB error when trying to build

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 🙂

This entry was posted in Fixes, Visual Studio and tagged . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

9 Comments

  1. Patrick
    Posted May 31, 2011 at 9:37 am | Permalink

    Thanks for the post!

    Indeed, I have an HP computer here and the same issue occured. Now solved, thanks again

  2. Daniel Dubé
    Posted July 25, 2011 at 1:25 am | Permalink

    Thankssssssssssssss

  3. roman
    Posted November 20, 2012 at 8:25 pm | Permalink

    thx, in my case Platform’s value was MCD… I’m also on a hp laptop.

  4. Posted December 19, 2012 at 5:46 am | Permalink

    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

  5. Posted February 5, 2013 at 10:49 am | Permalink

    Thanks for this post – it had me scratching my head for a good while!

  6. rumbastick
    Posted July 18, 2013 at 1:17 pm | Permalink

    Also have a HP laptop. HP laptops have software preinstalled that doesn’t do anything useful. Thanks for the solution!

  7. Eric
    Posted November 22, 2013 at 6:51 pm | Permalink

    Nice. Worked for me too. Thanks!

  8. pawan
    Posted April 26, 2016 at 9:17 am | Permalink

    Thanks, I have also scratched my head in too and solution worked for me.

  9. Posted November 25, 2016 at 5:26 pm | Permalink

    Should I say You are a STAR 🙂 , it may look simple, but the hard part of finding and posting it online 🙂

Leave a Reply