Creating Custom Build Rules

Depending on the type of project you are working with, you may need to have certain tasks completed prior to and after building your project. The Custom Build tab of the <Project> Properties dialog box allows you to specify commands that are to be executed before or after building a project. There are two text boxes on this tab - Pre-build and Post-build. The format of the commands entered into these text boxes should be identical to the commands used in a batch file (such as Autoexec.bat).

To add pre-build or post-build commands

  1. On the Project menu, click <Project> Properties (where <Project> is the name of the project that is currently selected in the Project Explorer).

    The <Project> Properties dialog box appears.

  2. Select the Custom Build tab.

  3. In the Configuration drop-down list, choose the build configuration for which you want the Custom Build tab settings to apply.

  4. Select the Pre-build command(s) box if you want to specify commands that will occur before your project is built. Select the Post-build command(s) box if you want to specify commands that will occur after your project has been built.

  5. Enter the commands you wish to specify for the selected build command type. Only one command should be specified on each line of the text box. When entering commands into the text box, you can use standard batch commands to specify conditions under which the commands should execute.