【发布时间】:2019-01-04 19:13:51
【问题描述】:
ThereareexistingStackOverflow 上已经有“There are no property pages for the selection”问题,但我遇到了一个新版本。
在我的例子中,在 Git 合并后,14 个项目中只有一个出现“没有可供选择的属性页”错误。关联的 .vcproj 文件没有显示明显的错误。
【问题讨论】:
标签: git visual-studio vcproj
ThereareexistingStackOverflow 上已经有“There are no property pages for the selection”问题,但我遇到了一个新版本。
在我的例子中,在 Git 合并后,14 个项目中只有一个出现“没有可供选择的属性页”错误。关联的 .vcproj 文件没有显示明显的错误。
【问题讨论】:
标签: git visual-studio vcproj
.vcproj 旁边是一个附加文件 .vcproj.filters。这控制解决方案资源管理器的布局。它的结构是这样的:
<ClCompile Include="A.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="B.cpp">
<Filter>Source Files</Filter>
</ClCompile>
这里的问题是,如果两个 Git 提交每个都添加这些文件之一。 Git Merge 不理解 XML,并将合并(相同的)关闭标签。这会留下两个<ClCompile> 标签和一个</ClCompile>。
解决方法是卸载项目Open With>XML editor .filters 文件,并找到丢失的</ClCompile>。
详细一点,使用<ClCompile Include="B.cpp" Filter="Source Files" />。属性不应该是子属性,Filter 的限定域明确表明这是一个属性。作为单线,这是合并安全的。
【讨论】: