Platform Toolset property in Visual Studio property sheets
Asked Answered
A

2

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?

Anticipate answered 15/5, 2015 at 16:12 Comment(3)
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.Tresatrescha
@Tresatrescha 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.Anticipate
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.Tresatrescha
S
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.

Stemware answered 21/9, 2016 at 15:41 Comment(0)
C
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.

Champac answered 24/4, 2019 at 21:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.