MEF No exports were found that match the constraint
Hi, i'm trying to implement MEF in my WPF app, however i'm getting this error, not sure why anymore. Everything looks correct for me
This is my plugin:
and this is part of my WPF App.xaml.cs
is there something wrong?
6 Replies
Note that your two
IPlugin
interfaces are different types
So the one which your plugin claims that it implements is a different interface to the one which your WPF app is trying to find implementations oflooks like its the same when I leave IPlugin interface in wpf app, and add project reference to plugin to use same interface
So your plugin references your WPF app, but your WPF app is trying to load the plugin? That's a circular dependency
Normally you need to have another assembly, which contains the common types that both your app and your plugin rely on
just as a quick test, also tried with creating another shared dll
this is what I have currently
both reference .Shared
hi @Lex Li you recommended me MEF yesterday, do you have any idea whats wrong here
I will stick to working samples like https://github.com/bezzad/MEF-Sample instead of rolling out my own.
GitHub
GitHub - bezzad/MEF-Sample: Sample of Managed Extensibility Framewo...
Sample of Managed Extensibility Framework (MEF). Contribute to bezzad/MEF-Sample development by creating an account on GitHub.
chatgpt for the win lol, idk how this happened but its working now