vs-mef icon indicating copy to clipboard operation
vs-mef copied to clipboard

Analyze MEF exports for correctness

Open AArnott opened this issue 6 years ago • 1 comments

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

AArnott avatar Apr 04 '18 17:04 AArnott

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.

AArnott avatar Apr 04 '18 17:04 AArnott