Hello everyone,
I am working on integrating SonarQube with our Dynamics 365 Customer Engagement (on-premise) development pipeline. The goal is to automatically enforce critical best practices for our customizations, specifically targeting:
Plugin best practices (e.g., avoiding infinite loops, using ITracingService
correctly, implementing efficient data retrieval with ColumnSet
).
Custom API and Custom Workflow Activity development patterns.
General .NET code quality that interacts with the Dataverse SDK.
While I have the basic SonarQube analysis working for C#, the out-of-the-box rules do not cover these platform-specific, mission-critical patterns.
Has anyone successfully implemented custom SonarQube rules specifically for Dynamics 365 CE development? I am seeking guidance on:
Targeted Rules: What were the most valuable D365-specific rules you created? (e.g., detecting plugins that don't retrieve the Target
entity image, or that perform synchronous web service calls).
Technical Approach: Did you use the SonarQube Custom Rules Tutorial for .NET (using the Roslyn-based SDK) to write these checks? How complex was the process of analyzing the SDK-specific code (like IPluginExecutionContext
)?
Plugin Registration: Beyond code analysis, did you find a way to integrate checks for plugin registration best practices (e.g., required images, run-in-user-context) into your CI/CD pipeline, or did you focus solely on the code itself?
Sharing Solutions: Is there a community project or repository where such custom rules are being shared? If not, would there be interest in starting one?
I believe this would be incredibly valuable for the entire D365 development community to improve the stability and performance of our customizations.
Any insights, code snippets, or experiences you can share would be greatly appreciated.
Thank you for your time and expertise.
DAnny3211
134
Daniyal Khaleel
132
Abhilash Warrier
70
Super User 2025 Season 2