'Custom PreBuild and PostBuild Macros

I am working on a PreBuild and PostBuild Events for My Custom Project Type. The events are running fine. While working on adding Custom Macros for my Build, those macros are automatically getting evaluated as empty even before the actual PreBuild or PostBuild action occurs.

I added a new task to set values for those Macros as MSBuild Properties with a Different Task which sets the MSBuild properties as a part of Outputs, and scheduled it to run before the PreBuild Task runs. The properties are getting set, however it looks like there is some other inbuilt task which is Evaluating the PreBuild string and replacing the locations where custom macros are used as Empty strings.

Is there a way call my Task which sets actual values for those custom macros and then evaluate the PreBuild and PostBuild Event text.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source