Must-share information (formatted with Markdown):Markdown
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
Version : 8.1 - what are you trying to achieve
CS Proj need to CS project is not analyze
Thanks in Advance
Must-share information (formatted with Markdown):Markdown
Thanks in Advance
Hello @prajith_M
It looks that you are using the SonarScanner CLI. It is mandatory to use the SonarScanner for MSBuild as the CLI scanner does not handle C# files so you end up with an empty project.
I hope this will help.
Regards
Amina
Hi @Amina_Boukhris Thank you very much for your response, Amina am stuck with below step,
Projects with names ending in “Test” or “Tests”. This behavior can be changed by providing the parameter sonar.msbuild.testProjectPattern
to the begin step (regex follows .NET Regular Expression in a case-sensitive way with the default value .*Tests?\.(cs|vb)proj$
). This regex is applied against the fullname of the .csproj
or .vbproj
which is why it’s recommended to keep at the end of your custom regex \.(cs|vb)proj$
.
I am not understanding this one, if you could have help me out to how to configure this Azure Devops its really helpful to me.
Thanks
Prajith
Hello @prajith_M,
The main takeaway from the documentation is the following:
SonarQube analyzes test projects differently from non-test projects, so it is important to correctly classify test projects.
This means the analysis will not behave the same whether the project being analyzed is a test project or a main project. An example of a difference, is that some rules will only be run for tests (such as this one, since it is test-related), and some rules will only be run on main files.
What the paragraph from the documentation:
means is that by default, any C# project having a named csproj file finishing with Test.csproj
or Tests.csproj
will be considered a test project. This is the default behaviour, but you can change it by setting the sonar.msbuild.testProjectPattern
analysis parameter to another value, allowing projects being named *Test.csproj
to be analyzed as a main project.
Having a project classified as a test one when it is not may be an issue, as many rules only apply to main projects at the moment.
( Note that no matter what you use as parameter for sonar.msbuild.testProjectPattern
, any assemly containing the word “Test”, or any assembly referencing unit test assemblies such as xUnit, NUnit , …will be classified as test )
Hope that helps.
Best,
-Chris