Hi @Jeroen van Langen ,
Welcome to Microsoft Q&A!
Visual Studio 2019 supports the .NET version 5 (Visual Studio 16.8 or later). Visual Studio 2022 supports the .NET version 6 and 7.
But you can try the following steps:
- Manually install the .NET 6 SDK.
- Update your VS2019 to the latest version
- Go to Tools > Options > Environment > Preview Features > enable “Use previews of the .NET Core SDK”.
- Restart your VS2019
- Change the target framework from .NET 5 to .NET 6
<TargetFramework>net6.0</TargetFramework>
- Save your project file and build your project again (it may have a warning)
If it still doesn’t work, I would like to recommend you use VS2022.
Or you can also report to product team to add .NET 6/7 support in VS2019:
Thanks for your understanding!
Sincerely,
Anna
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.