-
-
Notifications
You must be signed in to change notification settings - Fork 46
-
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?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 4 replies
-
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
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Is there a way to reset the options back to default? Maybe I somehow messed them up since I was missing --exclude "[FCCExcludeFromCodeCoverage]*"
.
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
Also framework version and test framework should be irrelevant.
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.