tags:

views:

171

answers:

2

Are there enums available in the .NET framework that have values for build flavor (Debug, Release) and build platform (Any CPU, x86, x64 etc)? I haven't been able to find anything on MSDN or Google.

It seems unnecessarily cumbersome to create my own.

For context: I'm creating a custom TFS2010 workflow activity that requires flavor and platform info. Currently these are entered in the build definition as free-from strings.

The default TFS build template has a dialog box (accessible in the build definition editor under Process\1.Required\Items to Build\Configurations to Build) that provides drop-down menus with this info pre-populated. I'd like to do something similar.

+1  A: 

Where would these enums reside? They have nothing to do with .NET, or C#, but only to the default configuration of Visual Studio.

Are you aware that you can create any number of build configurations? That would mean the "flavor" enum would not have a fixed set of elements.

What are you trying to accomplish with this?

John Saunders
I'm writing a custom TFS2010 action. Rather than the 'build master' having to manually enter strings (particularly for platform) it would be nice to have a drop-down list. The default TFS template provides this. Cheers.
Ben Hughes
Please edit your question with this information. In particular, for those of us who haven't yet done TFS 2010 customization, say where this dropdown list resides.
John Saunders
Question has been updated, thanks for your help.
Ben Hughes
Ben, what happens if you add a new build configuration? Does it appear in the dropdown? If so, you'll want to learn how that dropdown is populated. Probably from the list of configurations, which is probably part of the solution.
John Saunders
Adding a new configuration to the solution does not change the list of configurations shown in the TFS dialog: it still only contains Debug and Release. Cheers
Ben Hughes
A: 

No, there is no enum that contains "build flavor." There are indeed preprocessor definitions that contain at least some of this information. Your .net code should almost never make use of that information.

Brent Arias