Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 885
JC. Avatar asked Sep 29 '08 18:09

JC.


People also ask

What is the difference between a debug build and a release build?

The Debug configuration of your program is compiled with full symbolic debug information which help the debugger figure out where it is in the source code. Is Release mode is faster than Debug mode ? The Release mode enables optimizations and generates without any debug data, so it is fully optimized. .

How do I open a build event in Visual Studio?

In Solution Explorer, select the project for which you want to specify the build event. On the Project menu, click Properties. Select the Build Events tab.

What is post build event command line?

Pre/Post build events are useful when we wish to perform some operations before/after a project is built. These operations are nothing but the Shell commands being used from the command line. Think of a scenario where we build our library project and its . dll is saved into the Project/bin/Release directory.


1 Answers

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 
like image 77
Joseph Daigle Avatar answered Sep 30 '22 03:09

Joseph Daigle