0

It's weird. If I create a new project and choose DotNet 6 framework by Visual Studio 2022. I will get the NETSDK1045 error code. But create a new project from the console, everything is Ok.

sjvann
  • 1
  • 1

1 Answers1

0

Run dotnet --list-sdks and see if the expected .NET6 version is installed.

My guess is that you might have x86 issue. If you have installed x64 version, install x86 version and vice versa and test if the issue is gone. You can also try to repair your VS 2022 instance and/or upgrade to latest official version.

There is also a small probability that you select a project type that does not supports .NET 6 (for example .NET Framework Web App project type).

Also you may check your path contains the dotnet folders in the correct order for your architecture.

References:
https://learn.microsoft.com/en-us/dotnet/core/tools/sdk-errors/netsdk1045
VS2017 : Target framework drop down does not show .NET Core 2.1 option

K. B.
  • 3,342
  • 3
  • 19
  • 32