markallanson.net

Conditional Build Events in Visual Studio .NET

IF NOT $(ConfigurationName) == UnitTest GOTO end #

So, what does this bit of script do? Firstly it compares the current configuration to the configuration that I want to perform my build event for. Secondly, it negates this comparison, so that if the configuration is not what i’m looking for the branch jumps to the end without executing the build event. Lastly, if the configurations match, it performs the real actions of the build event. #


Categorised as: Tech


Comments are closed.