I’m using SQ 6.7.1. I created a Roslyn analyzer and tested it locally, everything works fine.
I then used the SDK to export it to SQ, I then dropped the new .jar in the extensions\plugins directory. Restarted SQ and I can now see my rule.
When I activate the rule for my Quality Profile and run my build SQ does execute all the rules except my new rule. I activated the logs and I can see that SQ is loading my analyzer, so it should run the rule.
I did some more testing, thinking that maybe the problem was my analyzer. So I created a brand new analyzer with VS 2017, compiled it and put it in SQ.
Same result sadly. If anyone has an idea I’d appreciate it
Hi @rlejeune. Could you give us the logs from the 3 different steps of the analysis? If you don’t want to make them public, you can send me a private message on this forum.
I finally found it with some help. Problem was that I was using a version of Roslyn too recent versus the project I was analyzing.
If I was to suggest something, an error message somewhere on the build, or in SQ would be cool Once I got back to an older version of roslyn everything started working just fine.
FYI the same issue was raised in the SonarQube Roslyn SDK at about the same time as creating this post so there’s been some duplication of effort investigating the problem. We worked out what the problem was in the GitHub issue.
In summary, the issues weren’t appearing because an “old” version of MSBuild was being used i.e. the analyzer referenced a newer version of Roslyn than the one being used by the instance of MSBuild -> MSBuild couldn’t create an instance of the analyzer -> no issues raised.
(As a general request to forum users, please don’t raise the same issue in multiple places, or at least if you do, cross-link them to make it clear they’re related. Thank you! )