views:

21

answers:

2

I made a simple change of a property to an auto property and broke the build because the property was referenced in a conditional compilation section. I was building in debug and the reference was in a section of code that's only compiled in release configuration. Is there any way to catch these errors without manually switching the build configuration in Visual Studio and building in each mode?

I have a CI server so the error was caught right away but I hate breaking the build.

+1  A: 

You need to build each configuration to see if something conditional breaks one of them. You can avoid the manual step using the 'batch build' option from the build menu though.

Rob Walker
Thanks, I didn't know about batch build.
Jamie Ide
+1  A: 

You have to build under each configuration.

Remember that if you were to use all the conditional compiled sections at the same time, its likely that it wouldn't build i.e. if is debug use a, if not use b.

You don't need to do it manually though - that said, double compilation time is an awful thing.

eglasius