Configuration questions #366
-
Hi, struggling with configuration, any help appreciated
To exclude I have tried FCCExcludeFromCodeCoverage/ in csproj, I have read over the setup guide lots of times, in case im missing something. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
This needs to be placed in a csproj that is directly referenced by your test project - see #363
This will works for non ms code coverage and conditionally for ms code coverage. Also, if you are using property group FineCodeCoverage it needs to be in the test project.
Did you tell visual studio about your .runsettings https://learn.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2022#specify-a-run-settings-file-in-the-ide I would use FCC auto generated runsettings unless you have a specific need otherwise you will have to specify replacements in your runsettings. For example
https://learn.microsoft.com/en-us/visualstudio/test/customizing-code-coverage-analysis?view=vs-2022#include-or-exclude-assemblies-and-members Also available to you is the ExcludeFromCodeCoverageAttribute which can be applied to a whole assembly - but not the case with Net Framework |
Beta Was this translation helpful? Give feedback.
-
Great thanks Tony, was that I didnt have a reference to the project in my test project, only a indirect reference. They are being ignored now by using the FCCExcludeFromCodeCoverage in csproj The only outstanding thing is why other nuget packages are being included, like moq for example, I dont understand why just these nuget packages are, and not all the other ones. |
Beta Was this translation helpful? Give feedback.
If they provide pdbs they will be included. Just use the ModulePath Exclude regular expression to exclude them.