question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Net config filters are not handled properly

See original GitHub issue

Describe the bug If a .netconfig file is defined with assemblyfilters, or classfilters, they are not taken into account.

To Reproduce

  1. Create a .netconfig file, and specify some assemblyfilters (In my case, was : assemblyfilters = -*.Test, to exclude my tests projects and classfilters = -*.g.cs to exclude generated files)
  2. run reportgenerator on cmd.
  3. filters are not applied

Maybe because default values of command line takes precedence over .netconfig file ?

[ReportGenerator]
	assemblyfilters =-*.g.cs
	classfilters =-*.Test
	reports = coverage.xml
	targetdir = coveragereport

Issue Analytics

  • State:closed
  • Created 5 months ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
hivenet-emmanuel-titancommented, Apr 19, 2023

Works like a charm, thanks

0reactions
danielpalmecommented, Apr 19, 2023

Thanks for the console output. Now I think I know what’s wrong.

There are 3 filter options in ReportGenerator:

  • assemblyfilters
  • classfilters
  • filefilters

image

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
Read more comments on GitHub >

github_iconTop Results From Across the Web

Filters in ASP.NET Core
Learn how filters work and how to use them in ASP.NET Core.
Read more >
ExceptionFilterAttribute not handling properties exceptions
basically, simple answer is simple: exception filter is action-level filter.
Read more >
Filters in ASP.NET Core MVC Application
Exception Filters are used to handle any unhandled exceptions that occur in our application. They do not have before or after methods. They ......
Read more >
Avoid Duplicating Code by Using ASP.NET Core Filters
Exception filters handle the unhandled exceptions that occur in controller creation, model binding, action filters, and action methods.
Read more >
Filters — ASP.NET documentation - Read the Docs
Exception filters handle unhandled exceptions, including those that occur during controller creation and model binding. They are only called when an exception ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found