Executing the Operation Before Build

Top  Previous  Next

Your external operation can be executed automatically before a build is performed in the Release configuration (not in the Debug configuration). Typically your operation should provide an admin option to enable or disable this feature.

To implement this automatic execution before a build you simply have to override the OnCreateUserOptionsForExecutionBeforeBuild method of the OperationBase class. In this method you should check if the admin options of this operation enable the execution before the build. If they do, then you should create and return an instance of the UserOptions class that you want to be used in the operation (see Providing User Options). The scope of the user options is ignored, since the operation will be executed on the projects that are being built.

Some of the external operations supplied as examples show how to enable execution before build.