SQ 10.5 "line is out of range for file" error on dotnet razor files

Seems the dotnet-sonarscanner nuget package is still 3 months old NuGet Gallery | dotnet-sonarscanner 6.2.0 and we still have this issue in our pipelines.

Hello @TimNilimaa and welcome to the community. As I’ve previously explained, the scanner does not include the analyzers. The scanner downloads analyzers from SonarCloud.

Are you using SonarCloud or SonarQube (what version)? Could you please share your verbose logs with us?

Share the Scanner for .NET verbose logs

  • Add /d:"sonar.verbose=true" to the…
    • dotnet sonarscanner begin
  • The important logs are in the END step

Share the msbuild detailed logs

MsBuild.exe /t:Rebuild /v:d

or

dotnet build -v:d

Where would you like me to send the logs?
We are using Sonarqube
v10.5 (89998)
Looking to move to Sonarcloud but currently trying to find out total number of LoC

The fix for this problem will be released in SonarQube 10.6.

Until then, please pin the .NET SDK version before you updated it, because:

You can pin the .NET SDK version below.

I’ll send you a private message so you can upload them there, just to double check it’s indeed the problem we fixed. Meanwhile, please pin the .NET SDK version and let us know if this mitigates the problem.

Thanks.

@TimNilimaa this is the link where you can access the private message (not accessible to other people) https://community.sonarsource.com/t/re-sq-10-5-line-is-out-of-range-for-file-error-on-dotnet-razor-files/116241

Is there an ETA for SonarQube 10.6?

Third week of June.

Until then, the workaround is to pin the dotnet version to a previous one.