Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
- SonarQube 9.1.0.4772
- Scanner 4.4.0.2
- what are you trying to achieve
Trying to compare the results of community vs. developer with a test repo. I would like to get one of the sample repos working first provided by SQ. I am using the sonarqube-scanner-msbuild.
- what have you tried so far to achieve this
Following the general setup instructions for a local instance I am running this in a VM
https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-msbuild/
Here is the output when I try:
dotnet sonarscanner begin /k:"sonarqube-scanner-msbuild2" /d:sonar.host.url="http://localhost:9000" /d:sonar.login="e7ef684742a120d9ed4a68ddad649847ad9324f8"
C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplication\Program.cs(4,18): warning S1118: Add a 'protected' constructor or the 'static' keyword to the class declaration. [C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplication\SomeConsoleApplication.csproj]
C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplication\Program.cs(9,17): warning S2583: Change this condition so that it does not always evaluate to 'true'; some subsequent code is never executed. [C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplication\SomeConsoleApplication.csproj]
C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplication\Program.cs(21,28): warning S3400: Remove this method and declare a constant for this value. [C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplication\SomeConsoleApplication.csproj]
SomeConsoleApplication -> C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplication\bin\Debug\SomeConsoleApplication.exe
Sonar: (SomeConsoleApplication.csproj) Project processed successfully
C:\Program Files\dotnet\sdk\5.0.400\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.QualityTools.UnitTestFramework". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\SomeConsoleApplicationTest.csproj]
C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\ProgramTests.cs(2,17): error CS0234: The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\SomeConsoleApplicationTest.csproj]
C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\ProgramTests.cs(7,6): error CS0246: The type or namespace name 'TestClassAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\SomeConsoleApplicationTest.csproj]
C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\ProgramTests.cs(7,6): error CS0246: The type or namespace name 'TestClass' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\SomeConsoleApplicationTest.csproj]
C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\ProgramTests.cs(10,10): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\SomeConsoleApplicationTest.csproj]
C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\ProgramTests.cs(10,10): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\SomeConsoleApplicationTest.csproj]
C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\ProgramTests.cs(20,10): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\SomeConsoleApplicationTest.csproj]
C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\ProgramTests.cs(20,10): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\SomeConsoleApplicationTest.csproj]
Build FAILED.
C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplication\Program.cs(4,18): warning S1118: Add a 'protected' constructor or the 'static' keyword to the class declaration. [C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplication\SomeConsoleApplication.csproj]
C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplication\Program.cs(9,17): warning S2583: Change this condition so that it does not always evaluate to 'true'; some subsequent code is never executed. [C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplication\SomeConsoleApplication.csproj]
C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplication\Program.cs(21,28): warning S3400: Remove this method and declare a constant for this value. [C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplication\SomeConsoleApplication.csproj]
C:\Program Files\dotnet\sdk\5.0.400\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.QualityTools.UnitTestFramework". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\SomeConsoleApplicationTest.csproj]
C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\ProgramTests.cs(2,17): error CS0234: The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\SomeConsoleApplicationTest.csproj]
C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\ProgramTests.cs(7,6): error CS0246: The type or namespace name 'TestClassAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\SomeConsoleApplicationTest.csproj]
C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\ProgramTests.cs(7,6): error CS0246: The type or namespace name 'TestClass' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\SomeConsoleApplicationTest.csproj]
C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\ProgramTests.cs(10,10): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\SomeConsoleApplicationTest.csproj]
C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\ProgramTests.cs(10,10): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\SomeConsoleApplicationTest.csproj]
C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\ProgramTests.cs(20,10): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\SomeConsoleApplicationTest.csproj]
C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\ProgramTests.cs(20,10): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\User\Desktop\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicationTest\SomeConsoleApplicationTest.csproj]
4 Warning(s)
7 Error(s)
I apologize if this a dumb mistake. I am new to SonarQube.
Thanks!
Drew