Issue Report: Compatibility Problem with SonarScanner for MSBuild and SonarQube

Environment Details:

  • SonarScanner for MSBuild Version:** 6.2
  • SonarScanner Version:** 5.0.1
  • CI Tool:** TeamCity

Description: We are experiencing failures when running SonarScanner for MSBuild as part of our CI build process on TeamCity. The issue manifests with both SonarScanner for MSBuild 6.2, as detailed below:

ERROR: Error during SonarScanner execution
java.lang.NoSuchMethodError: 'org.sonar.api.batch.AnalysisMode org.sonar.api.batch.postjob.PostJobContext.analysisMode()'
at com.uipath.sonar.plugin.hooks.DisplayIssuesInScanner.execute(
at org.sonar.scanner.postjob.PostJobWrapper.execute(
at org.sonar.scanner.postjob.PostJobsExecutor.execute(
Exception in thread "Thread-1" java.lang.NoClassDefFoundError: ch/qos/logback/classic/spi/ThrowableProxy
at ch.qos.logback.classic.spi.LoggingEvent.<init>(
at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(
at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(
at ch.qos.logback.classic.Logger.error(
at org.eclipse.jgit.internal.util.ShutdownHook.cleanup(
at java.base/
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.classic.spi.ThrowableProxy
at java.base/
at org.sonarsource.scanner.api.internal.IsolatedClassloader.loadClass(
at java.base/java.lang.ClassLoader.loadClass(
... 6 more
The SonarScanner did not complete successfully
Post-processing failed. Exit code: 1

Analysis: The error indicates that the PostJobContext.analysisMode() method, which is present in the SonarQube 5.6 API, is no longer available in later versions, such as the SonarQube 9.0 API. This discrepancy suggests a compatibility issue between the SonarScanner for MSBuild versions we are using and the SonarQube server version.

Request: Guidance on how to resolve this compatibility issue. Specifically:

  1. Which versions of SonarScanner for MSBuild may be more compatible with the current version of SonarQube as a TeamCity SonarScanner for MSBuild tool/plug-in?
  2. Are there any configuration changes or updates required to align the SonarScanner with the updated API of SonarQube?

Your assistance in resolving this issue would be greatly appreciated.

Hey there.

It looks like you’re issue is coming from this plugin:

It hasn’t been updated in 5 years, so it seems no longer maintained. You may be better off uninstalling it.

Thanks Colin, yep, it works. We actually exclude the file using that plugin.