My projectA published via ClickOnce depends on projectB. I need the projectB.dll.config file for projectA to work. While MSBuild copies over projectB.dll.config to projectA/bin/ConfigXY correctly, it is not published. VisualStudio (2017) doesn't even show the file in Application->Publish->Application Files.
As a workaround, I added this to A.csproj:
<Content Include="..\projectB\App.config">
<Link>projectB.dll.config</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
I think this is quite hacky, as it wouldn't work if projectB would use transformations, like projectA does. And it is not possible to do this directly in VisualStudio.
Why does MSBuild copy over the file correctly for build, but then doesn't publish it?
And what would be the best workaround?