C# file no analysis in a C# project by SonarScanner

First yestoday I use MsBuild tools analysis my C# project ,but unable to upload Analysis Report.
So today I use SonarScanner to do this work.

SonarQube version :7.9.4 on centos 7
C# Code Quality and Security :8.6.1
Client: windows 10

  1. The operating environment of sonarscanner has been set up on my PC, can be confirmed by pic sonar-scanne-version.png.
  2. Execute code " sonar-scanner - X" in cmd window, and the upload result can be seen in sonarqube.
  3. Bug, C# files are not analyzed, only JavaScript, CSS and HTML code are analyzed.

And another big project upload report fail,many times. Error content is “java.lang.OutOfMemoryError: Java heap space”, I’ve tried to adjust the size of sonarquer’s running memory.see sonar_etc_profile.png.
This measure didn’t work

What should I do next?




Analysis of execution process
fb_sonar.txt (82.2 KB)

Error details

java.lang.OutOfMemoryError: Java heap space
	at java.base/java.util.stream.SortedOps$SizedRefSortingSink.begin(SortedOps.java:348)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:501)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543)
	at org.sonar.core.issue.tracking.AbstractTracker.lambda$match$2(AbstractTracker.java:51)
	at org.sonar.core.issue.tracking.AbstractTracker$$Lambda$1389/0x00000001008c6440.accept(Unknown Source)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
	at org.sonar.core.issue.tracking.AbstractTracker.match(AbstractTracker.java:45)
	at org.sonar.core.issue.tracking.Tracker.trackNonClosed(Tracker.java:46)
	at org.sonar.ce.task.projectanalysis.issue.TrackerExecution.track(TrackerExecution.java:56)
	at org.sonar.ce.task.projectanalysis.issue.IssueTrackingDelegator.track(IssueTrackingDelegator.java:53)
	at org.sonar.ce.task.projectanalysis.issue.IntegrateIssuesVisitor.visitAny(IntegrateIssuesVisitor.java:59)
	at org.sonar.ce.task.projectanalysis.component.TypeAwareVisitorWrapper.visitAny(TypeAwareVisitorWrapper.java:77)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitNode(VisitorsCrawler.java:117)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:100)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:72)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:110)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:97)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:72)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:110)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:97)

I edit file $SONARQUBE-HOME/conf/sonar.properties .

sonar.ce.javaOpts=-Xms2048M -Xmx2048M -Xmn512M -XX:MaxPermSize=256M**
sonar.search.javaOpts=-Xms2048M -Xmx2048M -Xmn512M -XX:MaxPermSize=256M**

The problem has not been solved effectively.

Hi,

To analyze C# you must use the Scanner for MSBuild (soon to be renamed Scanner for .NET).

As a side note, the updates you made to sonar.properties affect the memory available to the SonarQube server itself, not the analysis.

The next step here would be to fall back to the .Net/MSBuild Scanner and diagnose why the analysis report wasn’t uploaded. I suspect you’re going to find that something on your network (perhaps an IIS proxy?) interfered with the transmission.

 
Ann

Hello,
I have upload SonarQube analysis and uoload logs in another topic.
Topic Url is Generation of the sonar-properties file failed. Unable to complete SonarQube analysis
I use two version MSBuild Scanner and upload logs.