Github pipeline fails after updating to .NET 7

Template for a good new topic, formatted with Markdown:

  • ALM used (GitHub)
  • Scanner command used when applicable (private details masked)
    dotnet build
  • Languages of the repository
    .NET 6 & .NET 7 (NuGet with multiple target frameworks)
  • Only if the SonarCloud project is public, the URL
    Drogecode.Blazor.Froala/build.yml at master · Drogecode/Drogecode.Blazor.Froala · GitHub
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
    C:\Program Files\dotnet\sdk\6.0.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [D:\a\Drogecode.Blazor.Froala\Drogecode.Blazor.Froala\Drogecode.Blazor.FroalaDemo\Drogecode.Blazor.FroalaDemo.csproj]


Welcome to the community!

It’s not clear to me what your intent is.


This isn’t a SonarQube issue.

Your pipeline runs on windows-latest and according to this it doesn’t include .NET 7.0 yet.

You need to use the setup-dotnet@v3 action to add the .NET 7.0 SDK, for example:

- name: Set up .NET 7.0
  uses: actions/setup-dotnet@v3
    dotnet-version: 7.0.x
1 Like

Thanks, this solved my issue.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.