If I have one type MyClass, register with
[Export(typeof(Myclass))]
attribute, and
[PartCreationPolicy(CreationPolicy.Shared)]
or
[PartCreationPolicy(CreationPolicy.NonShared)]
and later trying to call
compositionContainer.GetExportedValue<Myclass>()
multiple times.
Question: with the first call, I will get my registered class via MEF - llokup all registered assemblies, then trying to find one registered contract. Question is about second time and so on - will MEF do global lookup again or it caches somewhere internally?
GetExportedValue
should be done. – Ashurbanipal