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.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 15 (13 by maintainers)
Commits related to this issue
- ExcludeFromCodeCoverageAssemblyAttribute for excluding assemblies Treated like ExcludeFromCodeCoverageAttribute by OpenCover but doesn't clash with the public form of that attribute in being allowed ... — committed to JonHanna/corefx by JonHanna 8 years ago
- ExcludeFromCodeCoverageAssemblyAttribute for excluding assemblies Treated like ExcludeFromCodeCoverageAttribute by OpenCover but doesn't clash with the public form of that attribute in being allowed ... — committed to JonHanna/corefx by JonHanna 7 years ago
- ExcludeFromCodeCoverageAssemblyAttribute for excluding assemblies Treated like ExcludeFromCodeCoverageAttribute by OpenCover but doesn't clash with the public form of that attribute in being allowed ... — committed to JonHanna/corefx by JonHanna 7 years ago
@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.