创建一个可以在 Visual Studio 2015 中添加引用的 属性-Sheet

create a Property-Sheet that can Add-Reference in Visual Studio 2015

可以Add Reference to a project in Visual Studio 2015 using Property Sheet吗?
怎么样?

下图(添加引用)是我想要的,但我想使用 属性 Sheet.

此功能可能不再存在:-
https://msdn.microsoft.com/en-us/library/669zx6zc.aspx

The Common Properties configurations in earlier versions of Visual Studio have been removed. To add a reference to a project, you now use the Add Reference dialog in the same way as for managed languages. See Managing references in a project.

还有解决办法吗?
我想创建一个魔法 属性-sheet,然后 "just include a certain property-sheet, and everything will work!"(无需手动 添加引用)。

它还可以降低维护/重构项目的成本。

在 VS 中添加引用唯一要做的就是添加这样的东西

<ItemGroup>
  <ProjectReference Include="path\to\project.vcxproj">
    <Project>{e4abca85-42b0-4168-a628-e2287b9a8763}</Project>
  </ProjectReference>
</ItemGroup>

到项目文件。这只是标准的 msbuild 代码,所以你可以把它放在 属性 sheet 中(毕竟这只是 'msbuild file' 的另一个名称),如下所示:

<?xml version="1.0" encoding="utf-8"?> 
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <ProjectReference Include="path\to\project.vcxproj">
      <Project>{e4abca85-42b0-4168-a628-e2287b9a8763}</Project>
    </ProjectReference>
  </ItemGroup>
</Project>

效果一样;建造时,即。虽然它在 VS 中的 gui 不能很好地发挥作用:它会看到参考,但我不认为它能够在 属性 sheet 中修改它(比如设置 CopyLocal)所以调整 liek必须手动完成。再一次,如果你想要 属性 sheet 提供的可重用性,这似乎是一个很小的代价。