I have a custom msbuild task that is generating some output files to the output directory ($(TargetDir)) of a ProjectA. Current code is something like this:
Something like this seems to work, either include it manually into ProjectA's .csproj (keep in mind VS has a bad habit of occasionally resolving wildcards into absolute paths and overwriting .csproj) or inject dynamically by the custom task itself. Also, VS caches itemgroups on open, so it might not copy the files or fail the build if they were there but deleted. In that case projects need to be reloaded or VS restarted for itemgroups to be reevaluated. MSBuild, TFS, etc should always work.
%(Filename)%(Extension)
PreserveNewest