We have a nuget package we rely on but it has a .targets file that looks like this
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Reference Include="PackageName">
<HintPath>$(MSBuildThisFileDirectory)..\..\sdk\net45\PackageName.dll</HintPath>
</Reference>
</ItemGroup>
<PropertyGroup>
<PostBuildEvent>
pushd $(MSBuildThisFileDirectory)..\..\sdk\net45\
for /d %%i in (PackageName*) do (
xcopy "%%i" "$(TargetDir)%%i\" /S /Y
)
popd
</PostBuildEvent>
</PropertyGroup>
</Project>
We do not need nor want the copying of 400+ files to happen upon build, so how can we prevent this specific PostBuildEvent? We have been able to define
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
in our csproj but that eliminates all PostBuildEvents, whereas there may be a nuget package in the future where we want to obey its PostBuildEvent, we just dont want to obey this specific package's
We also want to keep the ItemGroup hints if possible, but if needed we can add them to our csproj