-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix S4159: Rule should handle generic interfaces when using System.ComponentModel.Composition #5641
Comments
Upon further investigation, it seems this may be your intention based on the unit tests. We are seeing this error because we are using MEF attributes, but they are consumed via DryIoc instead of the MEF container since DryIoc does support open generics. The PR which originally implemented it had a link to an msdn blog from 2009 that said they didn't support open generics but I think things have changed since then.
I can remove the type constraints and it still works but I'm more showing how we use it. |
Hi @inkahootz, thanks for reporting this. As far as I can tell there are two different problems:
We plan to address both topics. |
Thanks! |
Description
This is closely related to #1296, however that fix does not work for this specific MEF attribute type.
The rule raises an FP when implementing a generic interface and exporting it via
System.ComponentModel.Composition
.Repro steps
Expected behavior
The rule doesn't raise an issue.
Actual behavior
An issue is raised.
Known workarounds
This does NOT happen when using
ExportAttribute
fromSystem.Composition.AttributedModel
Please provide a description of any known workarounds.
Related information
The text was updated successfully, but these errors were encountered: