How to run Visual Studio post-build events for debug build only

JC. picture JC. · Sep 29, 2008 · Viewed 220.4k times · Source

How can I limit my post-build events to running only for one type of build?

I'm using the events to copy DLL files to a local IIS virtual directory, but I don't want this happening on the build server in release mode.

Answer

Joseph Daigle picture Joseph Daigle · Sep 29, 2008

Pre- and Post-Build Events run as a batch script. You can do a conditional statement on $(ConfigurationName).

For instance

if $(ConfigurationName) == Debug xcopy something somewhere