My teacher is horsed to use Visual Studio 2010 by the school, because they don\'t want to bother installing anything new. I\'ve been using Visual Studio 2015
Updated for Visual Studio 2017 and Visual Studio 2019
You can make this work actually, with just a few changes, if you only use the Visual Studio IDE itself (not MSBuild on the command line) to compile, with more or less full functionality on both platforms.
Unfortunately the rules for C++ projects are different than C#/.NET, and require some manual intervention, unlike the C# projects fairly automatic for round tripping after project "upgrade". These changes will require editing the project files manually.
Later versions of Visual Studio will override the tools version when the build is run through the IDE. Simply setting the ToolsVersion
to 4.0, to satisfy Visual Studio 2010 and then fixing the PlatformToolset
in a common property group to get the correct default action in the Visual Studio 2015 IDE will probably do it.
The reason for setting PlatformToolset
is so that the defaults for correctly when changing build properties, like when you go to Debug
or Release
settings in the IDE and choose
you will get the 2015 version by default and not 2010.
Steps for Visual Studio 2010, Visual Studio 2015, Visual Studio 2017, and Visual Studio 2019 cohabitation on same project file for C++:
1. Tools version to 4.0:
Debug
Win32
...
By changing only 14.0
to 4.0
in Project
tag for ToolsVersion
it becomes
Debug
Win32
...
2. Add common default value of PlatformToolset to v140 recognized only by Visual Studio 2015:
{12345678-9876-ABCD-DCCA-765FE987AA1F}
Win32Proj
myProject
8.1
By adding only the new PlatformToolset
line to the bottom of the PropertyGroup
it becomes:
{12345678-9876-ABCD-DCCA-765FE987AA1F}
Win32Proj
myProject
8.1
v140
v141
v142
To also load in Visual Studio 2017, a line with toolset v141
is additional required as shown above to continue to seamlessly cross load projects between all three.
In Visual Studio 2019, a line with toolset v142
is additional required as shown above to continue to seamlessly cross load projects between all four.