I have created a custom target in a .target file. The target defines an incremental build task. This target file is imported into several projects in a solution. The build task runs fine when I build each project, but when building the solution I have noticed that the build task is running for every project the target is imported into, even though it is defined as an incremental build task. What might be the possible reason for this behaviour?
Sharing an example of how the .target file looks like:
<Project> <Target Name="CustomBuild" Inputs="@(Input)" Outputs="@(Output)" BeforeTargets="PreBuildEvent"> <Exec Command="...." /> </Target> </Project>