vs-mef
vs-mef copied to clipboard
Analyze MEF exports for correctness
From @dgriffen on April 4, 2018 17:5
There should be a diagnostic checking if Export
declarations are correct. For example:
[Export(typeof(IBar))]
public class Foo { }
This should be flagged as incorrect since Foo
does not implement IBar
Copied from original issue: Microsoft/VSSDK-Analyzers#43
Strictly speaking, the exported type is its type identity, which need to be implemented by the exported object. So this isn't actually an error. However it seems reasonable to report this as a warning since it is likely to be an authoring mistake. We don't have any analyzers in vs-mef at this point, but adding them sounds valuable.