Добавить условие при переопределении свойства BuildDependsOn
:
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
...
<BuildDependsOn Condition="'$(Configuration)' == 'Release'">
BeforeBuild;
CoreBuild;
AfterBuild;
NewBuildTarget;
</BuildDependsOn>