“There are no property pages for the selection” er

2020-07-18 05:57发布

问题:

When I go to edit a properties page in Visual Studio 2015 with C++, I'm always getting the error, "There are no property pages for the selection." This usually happens when I'm switching from one Platform to another (e.g. x64 -> Win32).

Usually it will work if I switch the platform from the main window, but if I try to switch it in the Property Pages, I always get that error.

Thanks for the help.

回答1:

I think this is a bug that has been in Visual Studio since forever. Through experimentation I have discovered that you only hit this bug if you open the project properties by going to the Project menu and selecting <ProjectName> Properties.... Instead, if you open the Solution Explorer toolbar, and then right-click on the project and select Properties from the context menu, you will not hit this issue.



回答2:

This problem seems to be linked between MSBuild tools and environment paths. On visual studio 2017 v15, after I had downloaded MSBuild tools it updated the VCTarget path to

C:\Windows\Microsoft.NET\Framework64\v4.0.30319

where it should actually point to

C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin

In my case changing the environment path wasn't working and eventually I had to manually update the VCTargets path from regedit: HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions

also make sure the priority of path you define in environment variable is correct.