Is it possible (in Visual Studio using SonarLint extension) to disable Sonar Analyzers during Debug build, but keep them enabled in Release build? The reason is that connecting the solution to SonarQube has drastically increased the build time.
Just go to the project preferences and choose SonarLint. Then uncheck “Run SonarLint” automatically.
Save this answer. Show activity on this post. In Android Studio 3.5. 2: Go to File -> Settings -> Tools -> SonarLint -> Settings(Tab) then uncheck the Automatically trigger analysis check box.
To open this page, right-click the project node in Solution Explorer and select Properties. Select the Code Analysis tab. To disable source analysis at build time, uncheck the Run on build option. To disable live source analysis, uncheck the Run on live analysis option.
Adding SonarLint to Visual Studio Then in the search box, search for “SonarLint”. Once you see SonarLint, press “Download”. You must now sign out of Visual Studio to let the changes save properly. VSIX Installer will prompt you to allow for it to modify Visual Studio.
I ended up modifying the .csproj files to remove the analyzers if I'm building the solution from within Visual Studio in Debug configuration. That way, sonarlint does not complain that rules are outdated, nor does it get affected by updates. I got the answer from here
<Target Name="DisableAnalyzersForVisualStudioBuild"
BeforeTargets="CoreCompile"
Condition="'$(BuildingInsideVisualStudio)' == 'True' And '$(BuildingProject)' == 'True' And '$(Configuration)' == 'Debug'">
<!--
Disable analyzers when building a project inside Visual Studio. Note that analyzer behavior for IntelliSense purposes is not altered by this.
-->
<ItemGroup>
<Analyzer Remove="@(Analyzer)"/>
</ItemGroup>
</Target>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With