Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Platform Toolset property in Visual Studio property sheets

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?

like image 412
ForeverLearning Avatar asked May 15 '15 16:05

ForeverLearning


People also ask

How do I change the platform toolset in Visual Studio?

To change the platform toolsetIn the properties page, select Platform Toolset and then select the toolset you want from the drop-down list. For example, if you've installed the Visual Studio 2010 toolset, select Visual Studio 2010 (v100) to use it for your project. Choose the OK button to save your changes.

How do I open property pages in Visual Studio?

To open the Property Pages, choose Project > Properties from the main menu, or right-click on the project node in Solution Explorer and choose Properties. Individual files also have property pages that enable you to set compile and build options for just that file.

How do I add a .props file to Visual Studio?

right click on the project that you want to add a . props file for and choose "Add Existing Property Sheet". You can also choose to add a new property sheet. I have my property sheet in the same folder as my solution file so that all my projects can use the same property sheet.

How do I set the platform toolset in Visual Studio?

Setting the Platform Toolset in Visual Studio Open the property pages for your driver project. Right-click the driver project in Solution Explorer and select Properties. In the property pages for the driver project, click Configuration Properties and then click General.

What version of the platform toolset do I want to use?

The specific version of the platform toolset that you want to use is controlled by an MSBuild property called PlatformToolset. Projects can switch between tools and libraries by setting the PlatformToolset property in the project file.

How do I create a property sheet at the project level?

In large solutions that will have many projects, it can be useful to create a property sheet at the solution level. When you add a project to the solution, use Property Manager to add that property sheet to the project. If required at the project level, you can add a new property sheet to set project-specific values.

What platform toolset should I use for C++ projects?

Instead, use the Visual Studio 2013 (v120) platform toolset. By default, the PlatformToolset property is Visual Studio 2013 (v120) for both newly created Win32 user mode C++ projects and projects that were converted to Visual Studio 2013. In both cases, the PlatformToolset property is not written to the project file.


1 Answers

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.

like image 144
Boris Nikitin Avatar answered Oct 06 '22 02:10

Boris Nikitin