views:

484

answers:

3

In vs2008, C# build events are configuration-specific.

Looking for ideas on how to make my build event run only when doing a Release build.

Ideas?

A: 

VS2008 does support per-configuration build events. Check to see if you're setting build events when you have "All Configurations" selected in the project's property dialog.

Aaron Saarela
For C++ projects yes it does, but not for C# projects. A glaring oversight imho.
Brian Ensink
Thanks, have modified title, description and tags of the question.
theschmitzer
+1  A: 

Unfortunately the C# projects do not support anything like this that I have found. I have had to resort to writing makefiles in certain situations to get around this. You could also write a batch file or a simple program that accepts a parameter then call it like this from the build event:

custom.exe $(ConfigurationName)
Brian Ensink
+3  A: 

ok, along Brian's line, I'm doing this:

if "$(ConfigurationName)" == "Release" do_something

and it appears to work

theschmitzer