Why didn’t all my project files upgrade when moving from Visual Studio 2017 to Visual Studio 2019?
Since Visual Studio 2019 is binary-compatible with Visual Studio 2017, the Visual Studio 2017 libraries are used with Visual Studio 2019. However, one significant difference between the Visual Studio 2017 and Visual Studio 2019 libraries involves the Platform Toolset. The default Platform Toolset for Visual Studio 2017 is v141. The default Platform Toolset for Visual Studio 2019 is v142.
There are two ways to upgrade the Platform Toolset.
Open the solution file with Visual Studio and follow the upgrade prompts, or
On the Developer Studio command line, run:
devenv /upgrade <solutionFileName>
While the above two methods work for most situations, there are cases where Visual Studio fails to upgrade all of the projects within a solution. In these cases, you can either:
Build the solution from the command line using:
msbuild /p:PlatformToolset=v142' <solutionFileName>
or
Manually edit the project file(s) using a text editor or devenv /edit. Change all occurrences of '<PlatformToolset>v141</PlatformToolset>' to '<PlatformToolset>v142</PlatformToolset>' and save the project file(s).
Note: The method of using msbuild does not update the project file(s) on disk. It only overrides the platform toolset for the execution of the command. Use caution when editing project files manually. We recommend making a backup copy prior to editing project files.
Comments
dstockdill
Thu, 07/09/2020 - 06:04
Permalink
m
m