I
I
iremezoff2011-11-24 13:51:56
C++ / C#
iremezoff, 2011-11-24 13:51:56

Question for XaocCPS?

There was such a topic, a continuation was promised:
habrahabr.ru/blogs/net/95809/
Enthusiasm died? :)
So I looked at the code from the article and didn’t understand one thing, the application already knows about the existence of separate modules, or what?
Who is familiar with MEF, is it possible to connect assemblies there as with the help of reflection: look at the assembly metadata, find out if there is something that interests us, and connect at runtime?
ps: I'm writing in questions, because the personal is blocked by a corporate proxy. You can redirect this question to him in a personal, I will be grateful :)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
kreativf, 2011-11-24
@kreativf

Redirected

D
DraculaDIS, 2011-11-24
@DraculaDIS

The host may not be aware of individual modules. Here's an example of how to make it look for them in the specified folder:

        public Ctor()
        {
            var catalog = new DirectoryCatalog(@"C:\MEF\trunk\Test\Addons");
            var container = new CompositionContainer(catalog);
            container.SatisfyImportsOnce(this);
        }

        [ImportMany(typeof(IAddon))]
        private IEnumerable<IAddon> Addons { get; set; }

Today, by the way, I ran into a problem, in the loaded plugin, the custom configuration section that is defined in the same plugin does not want to resolve. I am loading a section from the config that is next to the plugin, but when deserializing it says that it cannot load the assembly =( maybe someone knows how to treat it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question