views:

201

answers:

1

In my VB.NET project I have three configurations DEBUG|TEST|RELEASE.

Currently when I am building using MSbuild and TeamCity I hard code the configuration, which smells badly!, to TEST

<Configuration Condition=" '$(Configuration)' == '' ">Test</Configuration>

Now before everyone screams at me not to hardcode this, the reason this was done was becuase we could NEVER seem to get $(Configuration) populated.

So my question is within MSBuild how can I read the currently selected configuration from the solution file commited to SVN?

+1  A: 

If I remember correctly, you can't. The currently selected configuration is a user setting and is therefore saved into the .user or .suo file, rather than into the solution file. And checking user settings files into SVN would make other developers angry.

In the TeamCity build runner configuration, you can select both the configuration and target you want to build. When building on the command line, you can also supply both. So why do you need to hard-code them into one of the project files?

Other than that, I like having a Test target instead of a Test configuration, because it seems more intuitive. But that might be just me.

OregonGhost