I am using Standalone scanning option in Prepare analysis on SonarQube task in Azure DevOps CI for .Net project.
I am using Self-hosted agent.
There are some constraint of using MSbuild scanning so we selected Standalone as a scan option.
When I run the CI pipeline and after successfully scanning the code and publishing the report if I check the report on SonarQube Dashboard I get the message “The main branch has no lines of code”.
If i check the Logs for Run code Analysis each and every files are getting scanned and indexed properly than to i am getting the above error.
Hi @chirag.ashiyani ,
Welcome to SonarSource Community!
Please add sonar.verbose=true to the extraProperties key in SonarQubePrepare task with Azure pipelines yaml and share the logs here.
If you want a quick solution that may not necessarily pertain to your problem, you can try this solution by setting
sonar.scm.exclusions.disabled=true, but you should check your logs first.
logs.txt (69.7 KB)
Please find attached Log.
I tried adding sonar.scm.exclusions.disabled=true than too the same error on Sonarqube Dashboard.
@chirag.ashiyani : Sorry, I reread your opening post. You should not use “Standalone” as scan option for your MSBuild or .NET project. You need to use
MSBuild for scanner mode. What constraint are you encountering? Can you show the original set of logs with your issue? Please add
SonarQubePrepare task to get debug logs. Please also show your azure pipeline yaml.