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

Rick Blacker 10 Reputation points
2024-06-27T16:34:46.2433333+00:00

Hi all... I have been searching all over the internet for a solution to this problem, and I thought I would come here to try and get it resolved after coming up empty...

Up till now, I have been using Visual Studio 2019 for other project types. Now, I need to do a .NET project using Entity Framework so, installed VS2022 alongside VS2019.

I created a brand-new Windows console application with VS2022 and immediately I started getting the error shown in the title.

dotnet --list-sdks

  • 5.0.416 [C:\Program Files\dotnet\sdk]
  • 6.0.302 [C:\Program Files\Epic Games\UE_5.1\Engine\Binaries\ThirdParty\DotNet\6.0.302\windows\sdk]
  • 8.0.302 [C:\Program Files\dotnet\sdk]

I've ensured that my project file looks correct with the proper version of .NET

<Project Sdk="Microsoft.NET.Sdk">    <PropertyGroup>     <OutputType>Exe</OutputType>     <TargetFramework>net8.0</TargetFramework>     <ImplicitUsings>enable</ImplicitUsings>     <Nullable>enable</Nullable>   </PropertyGroup>  </Project>

I've also read the information on this page and nothing seemed to be applicable to my problem.

https://learn.microsoft.com/en-us/dotnet/core/tools/sdk-errors/netsdk1045?f1url=%3FappId%3DDev17IDEF1%26l%3DEN-US%26k%3Dk(NETSDK1045)%26rd%3Dtrue

Also, I am really confused about the error itself. Isn't the current .NET SDK just .NET 8.0? What I have installed? Or is there some other software that might be out of date? And if so, what?

Thanks for any help you all can give me, I really appreciate it!!!

Rick

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,603 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Jiachen Li-MSFT 28,936 Reputation points Microsoft Vendor
    2024-06-28T03:45:57.9466667+00:00

    Hi @Rick Blacker ,

    Please change <TargetFramework>net8.0</TargetFramework> to

    <TargetFramework>net8.0-windows</TargetFramework>.

    Best Regards.

    Jiachen Li


    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.


  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more