The current .NET SDK does not support targeting. Net 6.0 Use target 5.0 or lower On Visual 2022 17.3.1

Jerohan Mukul 1 Reputation point
2022-08-17T21:34:38.193+00:00

Hello,
I have searched in this Forum and others, but I can't find the solution.

Any project I create using NET 6.0 (Core), does not allow me to run (web, windows, etc)

Example:

I create a WindowsForms project

232119-image.png

232155-image.png

After finish:
The current .NET SDK does not support targeting. Net 6.0 Use target 5.0 or lower

I'm using VS 2022 17.13.1

232142-image.png

And i have Installed this SDKs
232133-image.png

And my csproj

WinFormsApp4.csproj

<Project Sdk="Microsoft.NET.Sdk">  
  
  <PropertyGroup>  
    <OutputType>WinExe</OutputType>  
    <TargetFramework>net6.0-windows</TargetFramework>  
    <Nullable>enable</Nullable>  
    <UseWindowsForms>true</UseWindowsForms>  
    <ImplicitUsings>enable</ImplicitUsings>  
  </PropertyGroup>  
  
</Project>  

any ideas??

Developer technologies Visual Studio Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 31,056 Reputation points Microsoft External Staff
    2022-08-18T10:19:38.153+00:00

    Hi @Jerohan Mukul ,

    Welcome to Microsoft Q&A!

    Please see the document:
    https://learn.microsoft.com/en-us/dotnet/core/tools/sdk-errors/netsdk1045

    And check the global.json file as follows:

    {  
      "sdk": {  
        "version": "6.0.400"  
      }  
    }  
    

    If it doesn’t work, please try to repair your VS though Visual Studio Installer > More > Repair.

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.