Search code examples
xamarinsonarqubestylecopsonarlint

Xamarin and SonarQube


I'm currently working on Xamarin mobile applications and trying to use SonarQube as part of the CI process to enforce code quality.

Does anyone have any experience of doing this?

With my experimentation so far I've run into problems with SonarLint for Visual Studio and StyleCop and I don't know if this is because the projects are built using xbuild rather than Visual Studio or MSBuild.

The sorts or errors I'm seeing are

Unhandled Exception: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

This seems to happen after SonarLint for Visual Studio is invoked.

EDIT:

14:59:19.350 INFO  - SonarLint for Visual Studio version 1.3.0.0
14:59:20.154 ERROR - 
14:59:20.337 ERROR - Unhandled Exception: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
14:59:20.338 ERROR -    at System.Collections.Immutable.ImmutableDictionary`2.get_Item(TKey key)
14:59:20.340 ERROR -    at SonarLint.Runner.Configuration.AddAnalyzerCommentRegularExpression(Builder builder)
14:59:20.341 ERROR -    at SonarLint.Runner.Configuration.Analyzers()
14:59:20.341 ERROR -    at SonarLint.Runner.Program.Main(String[] args)

Solution

  • I managed to find out the source of the problem in the end.

    SonarLint KeyNotFoundException