How to configure GeneratedFileFilters of SonarC# to allow generated files

154 Views Asked by At

I would like to analyze a C# project with SonarQube. Some of my files have *.g.cs extension. Sonar C# plugin handles those files as if they are generated files and I get this error:

'SomeDirectory/ETitle.g.cs' excluded by org.sonarsource.dotnet.shared.plugins.GeneratedFileFilter

How can I include those files to sonar scan?

1

There are 1 best solutions below

0
On

The analysis of generated C# files can be enabled using the SonarQube or SonarCloud UI, in Project > Administration > General Settings > C#, and enabling the Analyze generated code option.