runtime: ExcludeFromCodeCoverageAttribute cannot be applied to assemblies

We have added ExcludeFromCodeCoverageAttribute back into our public API’s as part of the .NET Standard 2.0 work. We’ve been using a local version of this attribute in many of our test assemblies in order to control what shows up in our code coverage reports. The public version we are now exposing does not allow the attribute to be applied to assemblies, so our test assemblies cannot use the public version of the attribute. Test assemblies can continue using the internal version of the attribute, but then we get ambiguity warnings from the compiler, which we need to suppress.

We could potentially just allow the .NET Core version of the attribute to be applied to assemblies, even though the .NET Framework version doesn’t allow it.

@weshaggard

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (13 by maintainers)

Commits related to this issue

Most upvoted comments

@rodchenkov yes, it will be available in .NET Core 2.0, which is the upcoming shipping version. (Albeit - not legal to apply to assemblies, as mentioned above)

@rodchenkov in the meantime, you can use a different script to match a different attribute or with the common match of *.ExcludeFromCodeCoverage* just create your own with a matching name.