This is codeplex.com the vendor website while
stackoverflow.com is a general programming website.
I didn't find my answer yet, so I'm asking here.
Is it very strange to ask for a ExportFactory
which can create instances of parts with parameters in constructor ?!
And after one week still (all the week I was seeking the answer, stepping through
MEF code...) nobody knows the answer on stackoverflow.com.
And about your answer on stackoverflow.com I should say it would be a big security hole in my case. Exporting a
Func and importing it at the constructor of the part will reveal all the structure of parent (container) class to the using part. Parts are not fully trusted in my case. Also since I have no idea (from exporter side) who is calling the exported
Func so I need some identifier to be passed as parameter of the function. This way the part is claiming who he is. This is a security hole sine a part can claim to be somebody else and I will return sensitive data of another part to this one.
This problem can be solved by design at the point I'm creating the object. At that point, using metadata, I know which part I'm creating and easily can inject it's specific dependencies to its constructor.