...
If you need to analyze a “classic” .NET Framework 4.6+ project, use the MSBuild Sonar™Scanner task.
1 | Install and configure the SonarQube™ Scanner as described in https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-msbuild/ Make sure to download the appropriate version for your dotnet project. The task works as well with the .NET Core Global Tool, read the note on step 3 and 5. |
2 | Configure Build Agent Capability [local/remote agent] in Bamboo UI [remote agent] in the amboo-agent-home/bin/bamboo-capabilities.properties file define capability system.builder.dotnet.Dotnet=path/to/your/dotnet/home where Dotnet is the label that can be selected in the task configuration
|
3 | Add a Sonar™ Scanner for MSBuild - Begin Analysis task to your build plan Select the Dotnet Home Path capability from step 2. Configure the path to your SonarScanner.MSBuild.dll for .NET Core Global Tool use sonarscanner instead the path to the DLL ensure the .dotnet/tools folder is on the path, or add it as environment variable Image RemovedImage Added
Provide the required Sonar™ project parameters Image RemovedImage Added |
4 | Add a Script or Command task to build your build plan. Configure it to build your project. A minimal example may look like: Image RemovedImage Added |
5 | Add a Sonar™ Scanner for dotnet - End Analysis task to your build plan Select the Dotnet Home Path capability from step 2. Configure the path to your SonarScanner.MSBuild.dll for .NET Core Global Tool use sonarscanner instead the path to the DLL ensure the .dotnet/tools folder is on the path, or add it as environment variable
|
6 | Setup test coverage: |
...
Note |
---|
On SonarQube™ versions older than 9.3 you might encounter this error: Code Block |
---|
error 07-Jan-2022 14:50:44 Invalid project key. Allowed characters are alphanumeric, '-', '_', '.' and ':', with at least one non-digit. |
Update your tasks and enable option "Override branch character replacement" with the "-" character as value. |
Insert excerpt |
---|
| Getting started |
---|
| Getting started |
---|
name | git_info |
---|
nopanel | true |
---|
|