VSMEF016 Referenced metadata view interface should be source-generated
VSMEF016 warns when a C# import uses a metadata view interface declared in another assembly, but that referenced assembly did not emit MetadataViewImplementationAttribute for the interface.
Why this matters
VS MEF now generates metadata view implementations only in the assembly that declares the interface. Consuming assemblies do not generate implementations for referenced interfaces.
How to fix it
Recompile the assembly that declares the interface:
- Add a reference to the
Microsoft.VisualStudio.Compositionpackage to that project, if missing. - Apply MetadataViewAttribute to the interface.
- Declare the interface
partial.
After that assembly is rebuilt, consumers will observe the generated MetadataViewImplementationAttribute automatically.