Recently, I encountered a problem. The project I was using was developed in VS2019, but after being opened by VS2022, when I opened the project again in VS2019, there was a compatibility issue. In this blog, I will share solutions to this problem.
Problem description
When a project developed using VS2019 is opened once by VS2022 and open the project in VS2019 again, the following two problems will appear:
- This project is incompatible with the current version of Visual Studio
- Unable to find the build tool for v143
Solution
1. Modify the project solution file (.sln)
First, we need to modify the project solution file (.sln). Open the project's .sln file and find the following lines of code at the header of the file:
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.28315.86
Change the version number in these lines of code to the appropriate lower version number. For example, if we need to make the project compatible to VS2019, we can change the version number to:
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 15 VisualStudioVersion = 15.0.28315.86
Save the file to modify.
2. Modify the project file (.vcxproj)
Next, we need to modify the project file (.vcxproj). Find the project file (.vcxproj) and open it, search in the filev143
, will all appearv143
Replace withv142
. This is because VS2019 uses the v142 version of the generation tool, while VS2022 uses the v143 version of the generation tool.
Save the file to modify.
3. Reuse VS2019 to open the project
After completing the above two steps, we can re-open the project with VS2019. Now the project should be able to open successfully and no longer prompts for compatibility issues.
Summarize
The above method is suitable for projects that will be developed using a lower version of Visual Studio for compatibility with a higher version of Visual Studio. Before solving compatibility issues, we need to pay attention to checking other development environments on which the project depends, such as .NET, etc.
This is the article about solving the compatibility issues of VS2019 and VS2022 projects. For more related VS2019 and VS2022 projects, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!