Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How do you use the <FCCExcludeFromCodeCoverage/> csproj attribute? #186

Unanswered
fmcgarry asked this question in Q&A
Discussion options

I've tried to put in in the csproj file for a project that I did not want included in the coverage, but after running the analysis, the project still shows up in the coverage window. Am I misunderstanding how the attribute is supposed to be used?

You must be logged in to vote

Replies: 1 comment 4 replies

Comment options

Please see the zipped solution.

FCCExcludeFromCodeCoverage.zip

If you are still having trouble then can you provide the text in the FCC output window pane.
image

You must be logged in to vote
4 replies
Comment options

The solution you provided worked out of the box. However, for some reason, it's still not picking up the attribute in my projects. The following are differences between our solutions and what I've tried:

  • I'm using .NET Core 3.1 instead of .NET 5. I downgraded and it did not change anything.
  • I'm using MSTest instead of NUnit. Changing it didn't affect anything.
  • I was missing the --exclude "[FCCExcludeFromCodeCoverage]*" from mine, but adding it in didn't help.

image

Is there a way to reset the options back to default? Maybe I somehow messed them up since I was missing --exclude "[FCCExcludeFromCodeCoverage]*".

Comment options

The exclude "[FCCExcludeFromCodeCoverage]*" is the result of applying the attribute to a project called FCCExcludeFromCodeCoverage that is referenced by a test project.

You will have to provide your solution for me to comment further. In particular the .csproj file that you have annotated.

Comment options

Also framework version and test framework should be irrelevant.

Comment options

Can you show how you are referencing assemblies from the test project ?

You could just use the assembly attribute ExcludeFromCodeCoverage. FCCExcludeFromCodeCoverage just is a helper that provides the same functionality for .NET Framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /