Reputation: 1319
In my .net application, I have added new build modes for the configurations.
I currently have: Debug, Release, BetaDebug & BetaRelease. Each having a specific purpose for software engineering purposes.
I wish to know if I can get a C# string containing this text. So I can then do:
string configurationBuild = GetConfigurationBuild();
if(configurationBuild.Contains("Beta") {
//do something
}
else {
//do something else
}
Upvotes: 0
Views: 353
Reputation: 2577
You can configure that each configuration will define Conditional Compilation symbols use preprocessor instructions like #if to find out which build configurationis being used. Here is a link on msdn forum http://social.msdn.microsoft.com/Forums/vstudio/en-US/7d574468-c890-49d2-984e-16ad068a006e/build-configuration-in-preprocessor
Upvotes: 1
Reputation: 1002
You can use conditional compilation symbols ( http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=EN-US&k=k(CS.PROJECTPROPERTIESBUILD);k(TargetFrameworkMoniker-%22.NETFRAMEWORK%2cVERSION%3dV4.0%22)&rd=true ) for your build modes.
In your code you can then use the #if directive http://msdn.microsoft.com/de-de/library/4y6tbswk(v=vs.100).aspx
Upvotes: 1