A long existing feature in Visual Studio is the option to add a file from another location or project as a linked file to your project. If you change the original file the changes are reflected immediately in your project.
It is possible in .NET Core to directly specify this in the csproj. In Include
you give the relative path to the file from the project folder, and through the Link
property you tell MSBuild to add the file as a link.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ItemGroup> | |
<Content Include="..\Example.Infrastructure\Config\config.xml" Link="Config\config.xml" CopyToOutputDirectory="PreserveNewest" /> | |
<Compile Include="..\Example.Infrastructure\Config\SharedSettings.cs" Link="SharedSettings.cs" /> | |
</ItemGroup> |