We have been having a problem with sonar scanner version 8.20 (we also tried with 5.22 and 5.4). We have some property that are generated through Source generators. The build is working fine. However, running sonarscanner fails with these types of errors :
Error CS0117: ‘FirstStoreEntity’ does not contain a definition for ‘PropString1’
Error CS0117: ‘FirstStoreEntity’ does not contain a definition for ‘PropBool1’
Error CS0117: ‘FirstStoreEntity’ does not contain a definition for ‘PropInt1’
please give us the verbose output of the scanner commands (please run SonarScanner.MSBuild.exe begin /k:“MyProject” /d:sonar.verbose=true as the begin step, and please attach the output of the BEGIN and END steps)
please give the output of running MSBuild in verbose mode (/v:d)
Also, please tell us:
what are the commands you are running to do the analysis?
are you running all commands from the same folder?
Version of SonarQube → Community Edition Version 7.9.2 (build 30863)
Version of SonarScanner for .NET → 5.4.0
Version of MSBuild:
Task : .NET Core
Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command
Version : 2.187.0
Author : Microsoft Corporation
Help : .NET Core CLI task - Azure Pipelines | Microsoft Docs
For the record, I’ve tried reproducing the problem with @costin.zaharia 's POC (after changing the TFM to net6 in both projects - see PR) and could not. The analysis is successful (see on SC).
I’ve used sonar-scanner-msbuild-5.3.2.38712-netcoreapp2.0 and dotnet 6.0.100.