How to upgrade web parts from SharePoint 2010 to 2019?

kasperEH
kasperEH used Ask the Experts™
on
We are upgrading from SharePoint 2010 to 2019 (on premises), and I need to test the web parts I have developed. When I try to recompile in Visual Studio 2019, I get the error:
The required version of SharePoint Foundation or SharePoint Server is not installed on this system. The target version of the SharePoint project is 2010.
I have then tried to change the target framework to 4.7.2, but that didn't help. Please tell me how to change the setup. Thank you so much in advance.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
At first, I changed the framework in the .csproj file and it didn't work, but when I changed it in Properties - Application and tried to deploy the solution,  Visual Studio 2019 offered to upgrade the solution to SharePoint 2019.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial