I have a main app and a plugin. The main app is exporting an IHost object and the plugin is importing an IHost object. I ran mefx and it recognizes both of those. But when I do /causes on the plugin it gives me a ImportCardinalityMismatchException. My container sees the plugin, but when I call Me.container.getExports(of IController)() it doesn’t return anything.
My Controller looks like this:
Class Controller
Implements IController
' ...
<Import()>
Public Property Host As Lazy(Of IHost)
' ...
End Class
I had to
<ImportMany()>in my plugin. Then for the variable I was importing to I needed to make itIEnumerable(Of Lazy(Of IHost))Or useLazy(of IHost)if you want to do a<Import()>