Last post Feb 18, 2016 10:47 AM by Dragonlord
Feb 17, 2016 02:55 PM|Dragonlord|LINK
We have an existing application that uses MAF (system.addin) to load it's components. I'm trying to write a web front end for this application, and to that end I tried to include the controllers in the various addins. However these controllers don't seem
to be showing up. However controllers that are attached to dlls that are directly referenced in the project are showing up.
Does anyone have any pointers as to how I can get the controllers in the addins to show up?
Feb 17, 2016 03:36 PM|XIII|LINK
could it be you mean MEF instead of MAF? If so you might want to take a look at
Feb 17, 2016 03:47 PM|Dragonlord|LINK
No I mean MAF (system.addin) https://social.msdn.microsoft.com/Forums/en-US/cda7966e-9e81-4242-b613-129be6018f19/what-is-the-difference-between-mef-and-maf-framework?forum=wpf
The plugins are loaded into the current appDomain though
Feb 18, 2016 08:11 AM|Yohann Lu|LINK
From your description, I think you should activate the add-in. Once the add-in is activated, the host can call it just like any other object. You can try the following suggestion.
The host can examine, activate and unload the add-in. To activate a specific add-in, you can take the token and call Activate:
foreach(AddInToken token in addinTokens)
//TranslatorHostView view = token.Activate<TranslatorHostView>(AddInSecurityLevel.Internet);
string hello = view.Translate(“Bonjour”);
The more detailed information about Creating Extensible Applications with MAF (System.AddIn) for your reference:
MAF team has a blog at http://blogs.msdn.com/clraddins/. You can access and raise some questions.
Feb 18, 2016 09:06 AM|Dragonlord|LINK
Thanks, I'll give that a go :)
Feb 18, 2016 09:55 AM|Dragonlord|LINK
ok, the only thing that I wasn't doing was doing something with the addin, but now that I've done that, it's still not working :( I'll give their blog a go.
Feb 18, 2016 10:47 AM|Dragonlord|LINK
Ok, I've got it working. For future reference I ended up doing
Public Class MyAssembliesResolver
Public Overrides Function GetAssemblies() As ICollection(Of Assembly)
Dim baseAssemblies As ICollection(Of Assembly) = MyBase.GetAssemblies()
Dim assemblies As New List(Of Assembly)(baseAssemblies)
and then replacing the default resolver with my new resolver that doesn't do anything.