SonarLint does not show any Issues in Rider

I installed SonarLint in Rider and it works fine.

But if I try to bind a Project to a SonarQube Project I get this Error here in Log:

Omnisharp: [ERROR] Analysis of project (ProjectId, #23958e88-d084-4694-a0b0-d4bd5e79798d - ) failed, underlaying error: System.ArgumentException: Unrecognized active rules: S2758
Parameter name: activeRules
   at SonarLint.OmniSharp.DotNet.Services.Rules.RulesToReportDiagnosticsConverter.Convert(ImmutableHashSet`1 activeRules, ImmutableHashSet`1 allRules)
   at SonarLint.OmniSharp.DotNet.Services.DiagnosticWorker.SonarLintAnalysisConfigProvider.GetWithSonarLintRuleSeverities(Compilation compilation, IEnumerable`1 activeRules)
   at SonarLint.OmniSharp.DotNet.Services.DiagnosticWorker.SonarLintAnalysisConfigProvider.Get(Compilation originalCompilation, AnalyzerOptions originalOptions)
   at SonarLint.OmniSharp.DotNet.Services.DiagnosticWorker.SonarLintDiagnosticWorker.<AnalyzeDocument>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at OmniSharp.Roslyn.CSharp.Services.Diagnostics.CopiedCSharpDiagnosticWorkerWithAnalyzers.<AnalyzeProject>d__19.MoveNext()

And this results in “No Issues found” but the WebUI has Issues. Is there an Workaround to use the “Serverside/bound” Rules etc?

Regards Chris

1 Like

Common, 6 Days without any Response? Really?

I could really use some help with this issue too

I am also facing this issue when using SonarLint in connected mode with a paid SonarCloud instance.

This works just fine in Visual Studio 2019, but not in Rider. When looking into the issue it appears the 2 rules were recently added to the SonarAnalyzer.CSharp nuget package.

I am running version 6.0.0.37696 of SonarLint in Rider (latest as of today) and the rules still fail to run. I tried ignoring the rules in using local project properties without any luck, then I tried setting the same properties in my SonarCloud instance as seen below which also didn’t work. The rules are still bound to my ruleset file for the project and run in SonarLint for Rider.

Omnisharp: [ERROR] Analysis of project (ProjectId, #2b7a45b1-0dc9-4343-a168-7609bd6ba1c8 - project.csproj) failed, underlaying error: System.ArgumentException: Unrecognized active rules: S3260,S3267
Parameter name: activeRules
   at SonarLint.OmniSharp.DotNet.Services.Rules.RulesToReportDiagnosticsConverter.Convert(ImmutableHashSet`1 activeRules, ImmutableHashSet`1 allRules)
   at SonarLint.OmniSharp.DotNet.Services.DiagnosticWorker.SonarLintAnalysisConfigProvider.GetWithSonarLintRuleSeverities(Compilation compilation, IEnumerable`1 activeRules)
   at SonarLint.OmniSharp.DotNet.Services.DiagnosticWorker.SonarLintAnalysisConfigProvider.Get(Compilation originalCompilation, AnalyzerOptions originalOptions)
   at SonarLint.OmniSharp.DotNet.Services.DiagnosticWorker.SonarLintDiagnosticWorker.<AnalyzeDocument>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at OmniSharp.Roslyn.CSharp.Services.Diagnostics.CopiedCSharpDiagnosticWorkerWithAnalyzers.<AnalyzeProject>d__19.MoveNext()

Same issue here, on Paid SonarCloud instance.

Any updates on this, the plugin has become unusable because of this issue.

@JBL_SonarSource Pinging just to make sure someone from Sonarlint team is aware of this, as the post hasn’t been tagged with #sonarlint

I can reproduce this and it completely breaks SonarLint in Jetbrains Rider.

I had a look on the Github repo and in the Jira issue board and see no mention of this (critical!?) problem.

2 Likes

@tboby thanks for ping. The SonarLint team weren’t aware of this issue (I’ve added the sonarlint and rider tags). We’ll take a look.

Just to check, does the problem only affect connected mode?

1 Like

Yes, if I untick “Bind project to SonarQube / SonarCloud” and press “Analyze with Sonarlist” I immediately get issues found in the file. If I then tick it again the issue vanishes and no more issues are found.

The stack trace is the same as @reidj32 's from last month:

Omnisharp: [ERROR] Analysis of project (ProjectId, #fa80555d-86e8-42bf-8a20-d7971333dce8 - ) failed, underlaying error: System.ArgumentException: Unrecognized active rules: S3260,S3267
Parameter name: activeRules
   at SonarLint.OmniSharp.DotNet.Services.Rules.RulesToReportDiagnosticsConverter.Convert(ImmutableHashSet`1 activeRules, ImmutableHashSet`1 allRules)
   at SonarLint.OmniSharp.DotNet.Services.DiagnosticWorker.SonarLintAnalysisConfigProvider.GetWithSonarLintRuleSeverities(Compilation compilation, IEnumerable`1 activeRules)
   at SonarLint.OmniSharp.DotNet.Services.DiagnosticWorker.SonarLintAnalysisConfigProvider.Get(Compilation originalCompilation, AnalyzerOptions originalOptions)
   at SonarLint.OmniSharp.DotNet.Services.DiagnosticWorker.SonarLintDiagnosticWorker.<AnalyzeDocument>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at OmniSharp.Roslyn.CSharp.Services.Diagnostics.CopiedCSharpDiagnosticWorkerWithAnalyzers.<AnalyzeProject>d__19.MoveNext()

Thanks for the confirmation. I’ve created a ticket: #SLI-617.

FYI we’ve been discussing doing another Rider sprint for a month or so. This will push it up the priority list.

2 Likes

Hi,

This is to inform you that we published yesterday a bug fix release on the JetBrains marketplace to solve this particular issue. Let me know if you still face some issues.

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