Closed hivenet-emmanuel-titan closed 1 year ago
If you use a .netconfig
file, the values are only applied if you don't specify the corresponding command line parameter.
Command line always takes precedence.
The idea is, that you put common values in the .netconfig
file and only specify additional/deviating values on the command line.
I do not use any command line parameter
Maybe your .netconfig file is formatted in the wrong way? Maybe you need a space after the "="?
[ReportGenerator]
assemblyfilters = "-*.g.cs"
classfilters = "-*.Test"
reports = coverage.xml
targetdir = coveragereport
Nope, doesn't work.
Tried with the exact config you gave, and command line reportgenerator
I still have my \<projectName>.Test projects inside report.
And console output shows that .g.cs files are not excluded :
2023-04-19T11:52:05: File 'C:\Users\DuAel\source\repos\hive-cloudbridge\HiveCloudBridge.Common\System.Text.Json.SourceGeneration\System.Text.Json.SourceGeneration.JsonSourceGenerator\ModelGenerationContext.Volume.g.cs' does not exist (any more).
Thanks for the console output. Now I think I know what's wrong.
There are 3 filter options in ReportGenerator:
According to your console output you are trying to filter certain files. For files you have to use filefilters. Filefilters can be used to filter files within a class. If all files of a class are filtered, the whole class will be filtered.
E.g.
[ReportGenerator]
filefilters = "-*.g.cs"
classfilters = "-*.Test"
reports = coverage.xml
targetdir = coveragereport
Works like a charm, thanks
Describe the bug If a .netconfig file is defined with assemblyfilters, or classfilters, they are not taken into account.
To Reproduce
Maybe because default values of command line takes precedence over .netconfig file ?