8

The <PlatformToolset/> property is not exposed via project property sheets. It's unfortunate, as I have to run through several projects spread over several solutions to change this value if you are upgrading a compiler (to VS 2013 in my case).

I could write a script or a small program that can open vcxproj files, treat them as xml and insert this property at all the strategic locations, but that seems a bit hackish to me.

What is the recommended approach here?

ForeverLearning
  • 6,352
  • 3
  • 27
  • 33
  • When you load the project into a new version of Visual Studio, it (generally) prompts you to upgrade the project to the new version. Because this might be doing more than changing the `PlatformToolSet` tag, that's what I would recommend. – MuertoExcobito May 15 '15 at 17:08
  • @MuertoExcobito That won't work for people who use a later version of the IDE to compile code using older versions of compiler. I am pretty sure changing the PlatformToolset property is sufficient and everything seems to fall out of that. – ForeverLearning May 15 '15 at 17:12
  • You must have the older IDE installed to actually compile with the older PlatformToolSet, so, they might as well just use the older IDE. We support many different versions of VS, and maintain project files for each version. – MuertoExcobito May 15 '15 at 17:26

2 Answers2

1

You can insert reference to file with your settings

<Import Project="FILEWITHTOOLSETSETTINGS.props" />

before line:

<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

It is not a property sheet in terms of Visual Studio but it works.

Draken
  • 3,134
  • 13
  • 34
  • 54
Boris Nikitin
  • 369
  • 4
  • 12
0

I do the above solution, but if the vcxproj files have the platformtoolset version defined it doesn't work and will use that specified platformtoolset defined in the project.

I ended up removing all platformtoolset definitions from 2100 project files. I go back and forth on if I should have just made a product platform tool set property and just set the platform toolset to this property in the project.

I did edit the projects automatically as I needed to fix some other properties and build items. It wasn't to hard to automate.