“There are no property pages for the selection” error in Visual Studio, on one project only

784 views Asked by At

There are existing “There are no property pages for the selection” questions already on StackOverflow, but I ran into a new version.

In my case, after a Git merge only one project out of 14 had a “There are no property pages for the selection” error. The associated .vcproj file showed no obvious errors.

1

There are 1 answers

0
MSalters On

On the side of the .vcproj is an additional file, .vcproj.filters. This controls the layout of the Solution Explorer. It's structure is similar to this:

<ClCompile Include="A.cpp">
  <Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="B.cpp">
  <Filter>Source Files</Filter>
</ClCompile>

The problem here is if two Git commits each add one of these files. Git Merge doesn't understand XML, and will merge the (identical) close tags. This leaves you with two <ClCompile> tags and only one </ClCompile>.

The fix is to unload the project, Open With>XML editor the .filters file, and find the missing </ClCompile>.

P.S. Feature request to Microsoft

Be verbose, use <ClCompile Include="B.cpp" Filter="Source Files" />. Attributes should not be children, and the limited domain of Filter makes it clear that this is an attribute. As a one-liner, this is merge-safe.