I'm currently having an issue getting StyleCop.Analyzers to work with SonarQube. I'm using v6.7 of SonarQube, and I've tried this with multiple versions of the SonarC# plugin.
The recommended way to get the custom rules into SonarQube seems to be to use the SonarQube Roslyn SDK tool (https://github.com/SonarSource/sonarqube-roslyn-sdk) to generate a plugin from a Roslyn analyzer, in this case the StyleCop.Analyers NuGet package.
This seemed to work OK for both v1.0.0 and v1.1.0-beta of the package, and the rules show up in SonarQube for both - however using the latest version of SonarC# the project won't be scanned properly, and the number of C# lines of code & issues found is 0. However if you downgrade to v5.11 of the plugin, the project is scanned properly, it finds the ~2k lines of code, and any StyleCop warnings are shown properly as far as I can tell.
In the VSTS build it looks as though the plugin is working, because the StyleCop warnings do appear in the MSBuild stage (my understanding is that the SonarQube rules override any code analysis rules in the build), but they don't show at all in the summary on the project page in SonarQube.
The SQ Roslyn SDK project says it's compatible with v4.5 or higher of the C# plugin - but it doesn't look like it's being actively maintained.
I can't see any errors in the SonarQube logs, but there are a few warnings in the "Complete SonarQube analysis" task in VSTS:
2018-01-03T15:07:50.0734421Z WARNING: WARN: Protobuf file not found: null\output-cs\encoding.pb
2018-01-03T15:07:50.0734783Z WARNING: WARN: Protobuf file not found: null\output-cs\metrics.pb
2018-01-03T15:07:50.0735152Z WARNING: WARN: Protobuf file not found: null\output-cs\issues.pb
2018-01-03T15:07:50.0735516Z WARNING: WARN: Protobuf file not found: null\output-cs\token-type.pb
2018-01-03T15:07:50.0735888Z WARNING: WARN: Protobuf file not found: null\output-cs\symrefs.pb
2018-01-03T15:07:50.0736289Z WARNING: WARN: Protobuf file not found: null\output-cs\token-cpd.pb
Not really sure if this is an issue with the C# plugin or the SDK tool - has anyone else had any similar issues? Are there any workarounds other than using an older version of the C# plugin?