Common Files in Visual Studio Solution

前端 未结 2 1306
梦如初夏
梦如初夏 2021-02-15 09:59

Many times I have seen Visual Studio solutions which have multiple projects that share source files. These common source files are usually out in a common directory and in the

相关标签:
2条回答
  • 2021-02-15 10:23

    Thanks @aku!

    I knew this could be done, but I didn't know how to do this from Visual Studio. It shows up as a shortcut to the file and the csproj file generates the resulting XML like this:

    <Compile Include="..\CommonAssemblyInfo.cs">
      <Link>CommonAssemblyInfo.cs</Link>
    </Compile>
    

    I've seen this technique commonly used for common AssemblyInfo files to keep a consistent version.

    0 讨论(0)
  • 2021-02-15 10:36

    Right click on a project, select Add->Existing Item->Add as link (press on small arrow on Add button)

    0 讨论(0)
提交回复
热议问题