.netvisual-studio-2019version

The current .NET SDK does not support targeting .NET 6.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 6.0


I know this is a duplicate question. But I have tried every mentioned solution and didn't get resolved.

I have a dotnet c# application. when I run the application I got the below-mentioned error

The current .NET SDK does not support targeting .NET 6.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 6.0.

All the following solutions I have tried

  1. Download and install the dotnet-SDK-6.0.300 version.
  2. Updated the VS-2019 and checked the " Use preview of the .NET SDK (required restart)

Windows Edition: Windows 11

Still, it's not working. Got the same error. Help me out of this.


Solution

  • .NET 6 is supported with Visual Studio 2022 and Visual Studio 2022 for Mac. It is not supported with Visual Studio 2019, Visual Studio for Mac 8, or MSBuild 16. If you want to use .NET 6, you will need to upgrade to Visual Studio 2022 (which is also now 64-bit).