title: NETSDK1045: The current .NET SDK does not support 'newer version' as a target
body: <p>I've created a simple ASP.NET CORE 6 Web API. I then pushed it to Github. When I try to create a pipeline in <strong>Azure Devops</strong>, I'm getting the error.</p>
  <pre><code>C:\Program Files\dotnet\sdk\5.0.403\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET
     .TargetFrameworkInference.targets(141,5): error NETSDK1045: 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.
  </code></pre>
  <p>I've just downloaded VS 2022 community edition. I've installed .Net SDK 6.
  Here's my csproj file</p>
  <pre><code>&lt;Project Sdk=&quot;Microsoft.NET.Sdk.Web&quot;&gt;
  
    &lt;PropertyGroup&gt;
      &lt;TargetFramework&gt;net6.0&lt;/TargetFramework&gt;
      &lt;Nullable&gt;enable&lt;/Nullable&gt;
      &lt;ImplicitUsings&gt;enable&lt;/ImplicitUsings&gt;
    &lt;/PropertyGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;PackageReference Include=&quot;Swashbuckle.AspNetCore&quot; Version=&quot;6.2.3&quot; /&gt;
    &lt;/ItemGroup&gt;
  
  &lt;/Project&gt;
  </code></pre>
  <p>I chose what Azure devops suggested, so this is my yml file</p>
  <pre><code># ASP.NET
  # Build and test ASP.NET projects.
  # Add steps that publish symbols, save build artifacts, deploy, and more:
  # https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4
  
   trigger:
    - master
  
   pool:
      vmImage: 'windows-latest'
  
   variables:
      solution: '**/*.sln'
      buildPlatform: 'Any CPU'
      buildConfiguration: 'Release'
  
   steps:
      - task: NuGetToolInstaller@1
  
      - task: NuGetCommand@2
        inputs:
          restoreSolution: '$(solution)'
  
      - task: VSBuild@1
        inputs:
        solution: '$(solution)'
        msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package 
          /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true 
          /p:PackageLocation=&quot;$(build.artifactStagingDirectory)&quot;'
          platform: '$(buildPlatform)'
          configuration: '$(buildConfiguration)'
  
     - task: VSTest@2
         inputs:
           platform: '$(buildPlatform)'
           configuration: '$(buildConfiguration)'
  </code></pre>
  <p>I've followed what's said in t<a href="https://docs.microsoft.com/en-us/dotnet/core/tools/sdk-errors/netsdk1045" rel="nofollow noreferrer">his documentation</a>, but it's not working. The build is still failing like this</p>
  <p>[![enter image description here][2]][2]</p>
  <p>Thanks for helping</p>