I have a common target file that has AfterBuild . The target file is at solution level. All csproj Import custom target file using <Import Project=$(SolutionDir)\custom.targets
file. But the afterbuild in custom.targets never run for any of the csproj. What am I missing here ?
Custom Targets File has the below
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<OutputTargets Include="$(TargetDir)$(TargetName).???" />
<OutputSatellites Include="$(TargetDir)\**\$(TargetName).resources.dll" />
</ItemGroup>
<Target Name="AfterBuild">
<Copy SourceFiles="@(OutputTargets)" DestinationFiles="@(OutputTargets->'$(SolutionDir)Test.WebApp\Config\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(OutputSatellites)" DestinationFiles="@(OutputSatellites->'$(SolutionDir)Test.WebApp\Config\%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
</Project>
Above Target file is imported into each csproj within a solution.