I suggest you ...

Allow ExcludeFromCodeCoverageAttribute to be used on assembly level

It is great that code coverage analysis can be easily run from test explorer window in VS 2012. But I suppose that it is often not appropriate to analyze code in test assembly itself. I think that it well be appropriate to exclude test assemblies from code coverage totally by using ExcludeFromCodeCoverageAttribute on assembly level in those assemblies so they will not produce 'garbage' code coverage results.

Now it is not possible since ExcludeFromCodeCoverageAttribute cannot be used at assembly level. There are several possible targets for this attribute however, allowing for some flexibility. I think, it will be convenient to allow assembly level as well (with corresponding support from code coverage analyzer).

56 votes
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
miegir shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

Thanks for taking the time to share this suggestion. This item has been around for a couple of versions of Visual Studio and we haven’t acted on it. Looking at the VS “15” plans, we’re not going to take action on this item, so we’re going to close it. If the suggestion is still relevant, please either take a look to see if there’s another suggestion that’s similar that you can vote on, or open a new suggestion.

- The Visual Studio Team

7 comments

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...
  • bojingo commented  ·   ·  Flag as inappropriate

    This is really essential given the new Test Explorer window in VS 2012. Used to be you had to opt-in the assemblies to be covered in 2010. Now the code coverage metric is much ****** to make sense of.

  • abatishchev commented  ·   ·  Flag as inappropriate

    Noticed the following:
    if there is no run settings in solution, projects' output only is being annualized (say, MyProject.Core.dll and MyProject.Core.Test.dll),
    if specify exclude in run setting then all files in solution output (i.e. also Moq.dll, FluentAssertions.dll, etc.) are also analyze.
    And there is not way to specify MyProject.Core.dll ONLY.

  • Justin Nimmo commented  ·   ·  Flag as inappropriate

    I just noticed referenced assemblies are added to code coverage results in TFS builds in 2012. They truly do produce garbage results.

  • Raffaeu commented  ·   ·  Flag as inappropriate

    Please do it, otherwise we will just move to dotCover and bye bye VS Ultimate ;)

Feedback and Knowledge Base