Chris Eargle

Life Student of the Kodefu Arts

Environment Variables and MSBuild

by chris 20. September 2008 06:26

Everything worked fine the last time I gave my MSBuild presentation. There were no changes to my files, so imagine my surprise when I load things up to practice today only to be met by failures. 

"C:\Demos\Introducing MSBuild\AccountManager\example01.proj" (default target) (1) -> "C:\Demos\Introducing MSBuild\AccountManager\AccountManager.sln" (default target) (2) -> (ValidateSolutionConfiguration target) ->  C:\Demos\Introducing MSBuild\AccountManager\AccountManager.sln.cache(81,5): error MSB4126: The specified solution configuration "Debug|MCD" 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.

The problem indicated by this error message is that the solution configuration is Debug|MCD. More specifically, this means that the platform equals MCD. I looked through all the solution files to find this mysterious MCD platform. I found nothing anywhere. Then I set the property through the msbuild commandline, and everything worked perfectly. The perplexing thing was that I set it to default in the project file if it was empty.

That was the key. It wasn't empty by the time the project file got ahold of it.

Environment variables are passed into MSBuild as properties. Keep this in mind if you're trying to figure out while your builds fail from certain machines due to errors being thrown from invalid property values. In fact, my problem came about because I purchased a new laptop from Gateway. I'm not sure what software they installed that set the environment variable, but it has the potential to wreak havoc on your build process if transitioning to a new build server.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

msbuild, environment variables

Kodefu

E-mail | Kick it! | DZone it! | del.icio.us
Permalink | Comments (0) | Post RSSRSS comment feed

Related posts

Set Operations in MSBuildThere are scenarios where the situation calls for performing set operations on item collections. You...Introducing MSBuildThe Introducing MSBuild presentation.Parsing Properties and ItemsMSBuild files are loaded and parsed in order. This means that properties and items are in scope if t...
Saving the comment

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

November 21. 2008 05:48

Powered by BlogEngine.NET 1.3.1.0
Theme by Mads Kristensen

About the author

Chris Eargle Chris Eargle
Enterprise .NET developer in Columbia, SC.

E-mail me Send mail

Pages

  • Presentations

Twitter Updates

    Recent comments

    • Dev InTENsity (3)
      Chris Eargle wrote: Thanks for attending my presentations, Seth! In… [More]
    • Set Operations in MSBuild (1)
      FreeToDev wrote: Very nice post. Makes me wonder why I wrote tasks … [More]
    • Dev InTENsity (3)
      Seth Richards wrote: I saw both your C# 3.0 (I came up with the 'why ex… [More]
    • Dev InTENsity (3)
      Scott Ames wrote: I went to your presentation in Walthan for Code Ca… [More]
    • Generics Don't Make Me Sad (1)
      Matt Sheppard wrote: Cheers, I can't remember if I was aware of either… [More]
    • C# 3.0 Presentation (1)
      vijay wrote: Good post Thanks, Vijay [More]
    • Format Solution (4)
      Joe wrote: I added a couple of lines to FormatProjectItem() t… [More]
    • Sessions Galore (1)
      Lou wrote: I'll have to get you down here soon - I'll e-mail … [More]
    • Redeemed (3)
      Fred Beiderbecke wrote: It wasn't you, it was some of the others in the ro… [More]
    • South Florida Code Camp (1)
      Jason Meridth wrote: You've mentioned the only latest difference betwee… [More]

    Archive

    • 2008
      • January (4)

    Tags

    • activex
    • addin
    • ado.net data services
    • ajax
    • architecture
    • astoria
    • azure
    • beta
    • bug
    • c#
    • code camp
    • com
    • consolas
    • continuous integration
    • conversion
    • ctp
    • database
    • deployment
    • design
    • design principles
    • download
    • ebook
    • entity
    • entlib
    • environment variables
    • expression blend
    • fail
    • font
    • framework
    • gadget
    • generics
    • grid
    • guidelines
    • icon
    • interfaces
    • jacksonville
    • lamdba
    • linq
    • linqtosql
    • list
    • live mesh
    • macro
    • mobile
    • msbuild
    • msdn
    • msi
    • mvc
    • powertoy
    • preview
    • properties
    • ray ozzie
    • refactoring
    • regasm
    • russ fustino
    • security
    • serialization
    • silverlight
    • snippet
    • source code
    • sql server
    • sqlmetal
    • starter kit
    • stream
    • string
    • trial
    • usability
    • ux
    • vbscript
    • vista
    • visual studio
    • vs2008
    • wcf
    • web
    • winforms
    • wpf
    • xml

    Categories

    • RSS feed for Bleeding EdgeBleeding Edge (5)
    • RSS feed for CEDGCEDG (2)
    • RSS feed for GeneralGeneral (1)
    • RSS feed for KodefuKodefu (19)
    • RSS feed for Path NotesPath Notes (7)
    • RSS feed for PresentationPresentation (5)
    • RSS feed for TechniquesTechniques (2)
    • RSS feed for TrainingTraining (5)
    • RSS feed for WeaponsWeapons (4)
    • RSS feed for ZenZen (5)

    Archive

    Blogroll

    • RSS feed for Structure Too BigStructure Too Big
      • Should you buy an exten...
      • WorldMaps Update
      • MSDN Roadshow -- coming...
    • RSS feed for Chris CraftChris Craft
      • Pimp My Phone – D...
      • Pimp My Phone – D...
      • Pimp My Phone – D...
    Download OPML file OPML

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2008

    Sign in