SonarScanner for MSBuild

Need some help here. I am trying to publish some results over a C# project on a remote SonarQube server and I am constantly getting “errorMessage”:“Java heap space” in the report task. I am using
sonar-scanner-msbuild- and I have tried most of the suggestions found over the internet :

  • setting SONAR_SCANNER_OPTS to a bigger value
  • excluding *.doc *.docx files

My .bat file looks something like this :

set SONAR_SCANNER_OPTS=-Xmx3G -Xms512m -XX:+HeapDumpOnOutOfMemoryError
SonarQube.Scanner.MSBuild.exe begin /k: / /d:sonar.login= /d:sonar.exclusions=/*.doc,/.docx,**/.ipch
SonarQube.Scanner.MSBuild.exe end /d:sonar.login=
cmd /k

It is strange that with local Sonar Qube server it worked and it posts the results but when trying to add a remote server it fails with the above error.

Any suggestions?

Thank you!