<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://www.codeplex.com/rss.xsl"?><rss version="2.0"><channel><title>MEF Issue Tracker Rss Feed</title><link>http://www.codeplex.com/MEF/WorkItem/List.aspx</link><description>MEF Issue Tracker Rss Description</description><item><title>Commented Issue: Calls to ToUpperInvariant () break compatibility on unix-like file systems. [8831]</title><link>http://mef.codeplex.com/WorkItem/View.aspx?WorkItemId=8831</link><description>The Code makes a few calls to ToUpperInvariant &amp;#40;&amp;#41; related to files. In particular it does so twice in DirectoryCatalog.cs . This makes it impossible to use the code on filesystems that are case-sensitive. &amp;#40;I&amp;#39;ve tested this with Mono on Linux.&amp;#41;&lt;br /&gt;</description><author>jhurliman</author><pubDate>Thu, 12 Nov 2009 01:32:32 GMT</pubDate><guid isPermaLink="false">Commented Issue: Calls to ToUpperInvariant () break compatibility on unix-like file systems. [8831] 20091112013232A</guid></item><item><title>Created Issue: Dynamic dll doesn't load the ServiceReference.config [9069]</title><link>http://mef.codeplex.com/WorkItem/View.aspx?WorkItemId=9069</link><description>When a xap is downloaded it seems that the PackageCatalog doesn&amp;#39;t load the ServiceReference.ClientConfig file into memory. Thhis leads into the WCF client cannot be instantiated&lt;br /&gt;</description><author>al011757</author><pubDate>Thu, 29 Oct 2009 01:30:37 GMT</pubDate><guid isPermaLink="false">Created Issue: Dynamic dll doesn't load the ServiceReference.config [9069] 20091029013037A</guid></item><item><title>Created Issue: ImportMany and ICollection&lt;T&gt; implementations [8973]</title><link>http://mef.codeplex.com/WorkItem/View.aspx?WorkItemId=8973</link><description>If the custom collection type has more than one implementation of ICollection&amp;#60;T&amp;#62;, &lt;br /&gt;Import fails and the error description is misleading. I had to download source code and debug.&lt;br /&gt;&lt;br /&gt;Easiest way to describe is some code&amp;#58;&lt;br /&gt;________________________________________&lt;br /&gt;SampleCollection&amp;#60;T&amp;#62; &amp;#58; Dictionary&amp;#60;string, T&amp;#62;, ICollection&amp;#60;T&amp;#62;&lt;br /&gt;&amp;#123; ... &amp;#125;&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;&amp;#91;ImportMany&amp;#40;typeof&amp;#40;IService&amp;#41;&amp;#41;&amp;#93;&lt;br /&gt;SampleCollection&amp;#60;IService&amp;#62; services&amp;#59;&lt;br /&gt;__________________________&lt;br /&gt;&lt;br /&gt;Here, import fails because Dictionary also implements ICollection&amp;#60;KeyValuePair&amp;#60;string, IService&amp;#62;&amp;#62;.&lt;br /&gt;Reflection code throws an exception because of ambiguity. &lt;br /&gt;Why not it does not check directly for ICollection&amp;#60;IService&amp;#62; implementation&amp;#63; I don&amp;#39;t know, maybe because of another use case.&lt;br /&gt;&lt;br /&gt;BTW, source code for preview 7 is missing, I had to revert back to preview 6.&lt;br /&gt;</description><author>orca</author><pubDate>Tue, 13 Oct 2009 10:10:08 GMT</pubDate><guid isPermaLink="false">Created Issue: ImportMany and ICollection&lt;T&gt; implementations [8973] 20091013101008A</guid></item><item><title>Commented Issue: Calls to ToUpperInvariant () break compatibility on unix-like file systems. [8831]</title><link>http://mef.codeplex.com/WorkItem/View.aspx?WorkItemId=8831</link><description>The Code makes a few calls to ToUpperInvariant &amp;#40;&amp;#41; related to files. In particular it does so twice in DirectoryCatalog.cs . This makes it impossible to use the code on filesystems that are case-sensitive. &amp;#40;I&amp;#39;ve tested this with Mono on Linux.&amp;#41;&lt;br /&gt;Comments: ** Comment from web user: nblumhardt ** &lt;p&gt;Thanks for letting us know, we&amp;#39;ll look into this.&lt;/p&gt;&lt;p&gt;Nick&lt;/p&gt;</description><author>nblumhardt</author><pubDate>Fri, 02 Oct 2009 21:11:02 GMT</pubDate><guid isPermaLink="false">Commented Issue: Calls to ToUpperInvariant () break compatibility on unix-like file systems. [8831] 20091002091102P</guid></item><item><title>Closed Issue: ImportMany error fails silently [8830]</title><link>http://mef.codeplex.com/WorkItem/View.aspx?WorkItemId=8830</link><description>Situation&amp;#58;&lt;br /&gt;You have a class A with an ImportMany of contract type X.  Another class B that exports contract type X also has an Import of contract type Y &amp;#40;not an ImportMany, just an Import&amp;#41;.  There is no one that exports contract type Y.&lt;br /&gt;&lt;br /&gt;I would expect this situation to throw a CompositionException, but instead the ImportMany-of-contract-X in class A is simply missing class B with no error given.  In debugging this issue, I was unfamiliar with class B &amp;#40;and didn&amp;#39;t know at first that it was Import&amp;#39;ing anything&amp;#41; and it therefore took me a long time to debug the issue, whereas a CompositionException would have pointed me to the cause immediately.  I can&amp;#39;t think of a situation where a silent failure of any Import of cardinality 1 would be preferable to a CompositionException, even if that failed Import is &amp;#34;hidden&amp;#34; under an ImportMany.  A failed cadinality-1 Import is a failure, regardless of where in the composition it happens.&lt;br /&gt;&lt;br /&gt;This is with preview 6.&lt;br /&gt;Comments: &lt;p&gt;&lt;/p&gt;</description><author>nblumhardt</author><pubDate>Fri, 02 Oct 2009 21:03:41 GMT</pubDate><guid isPermaLink="false">Closed Issue: ImportMany error fails silently [8830] 20091002090341P</guid></item><item><title>Commented Issue: ImportMany error fails silently [8830]</title><link>http://mef.codeplex.com/WorkItem/View.aspx?WorkItemId=8830</link><description>Situation&amp;#58;&lt;br /&gt;You have a class A with an ImportMany of contract type X.  Another class B that exports contract type X also has an Import of contract type Y &amp;#40;not an ImportMany, just an Import&amp;#41;.  There is no one that exports contract type Y.&lt;br /&gt;&lt;br /&gt;I would expect this situation to throw a CompositionException, but instead the ImportMany-of-contract-X in class A is simply missing class B with no error given.  In debugging this issue, I was unfamiliar with class B &amp;#40;and didn&amp;#39;t know at first that it was Import&amp;#39;ing anything&amp;#41; and it therefore took me a long time to debug the issue, whereas a CompositionException would have pointed me to the cause immediately.  I can&amp;#39;t think of a situation where a silent failure of any Import of cardinality 1 would be preferable to a CompositionException, even if that failed Import is &amp;#34;hidden&amp;#34; under an ImportMany.  A failed cadinality-1 Import is a failure, regardless of where in the composition it happens.&lt;br /&gt;&lt;br /&gt;This is with preview 6.&lt;br /&gt;Comments: ** Comment from web user: nblumhardt ** &lt;p&gt;This is part of Stable Composition, and is by design. You can get some ideas of scenarios where this behaviour is desirable here&amp;#58; http&amp;#58;&amp;#47;&amp;#47;blogs.msdn.com&amp;#47;nblumhardt&amp;#47;archive&amp;#47;2009&amp;#47;07&amp;#47;17&amp;#47;light-up-or-mef-optional-exports.aspx&lt;/p&gt;&lt;p&gt;Debugging can be tricky but there are tools available that make it a ten-second task, e.g. see http&amp;#58;&amp;#47;&amp;#47;blogs.msdn.com&amp;#47;nblumhardt&amp;#47;archive&amp;#47;2009&amp;#47;09&amp;#47;24&amp;#47;debug-composition-from-within-visual-studio.aspx&lt;/p&gt;&lt;p&gt;Thanks for raising this&amp;#33;&lt;/p&gt;&lt;p&gt;Nick&lt;/p&gt;</description><author>nblumhardt</author><pubDate>Fri, 02 Oct 2009 21:03:30 GMT</pubDate><guid isPermaLink="false">Commented Issue: ImportMany error fails silently [8830] 20091002090330P</guid></item><item><title>Created Issue: Calls to ToUpperInvariant () break compatibility on unix-like file systems. [8831]</title><link>http://mef.codeplex.com/WorkItem/View.aspx?WorkItemId=8831</link><description>The Code makes a few calls to ToUpperInvariant &amp;#40;&amp;#41; related to files. In particular it does so twice in DirectoryCatalog.cs . This makes it impossible to use the code on filesystems that are case-sensitive. &amp;#40;I&amp;#39;ve tested this with Mono on Linux.&amp;#41;&lt;br /&gt;</description><author>jroith</author><pubDate>Wed, 23 Sep 2009 20:38:51 GMT</pubDate><guid isPermaLink="false">Created Issue: Calls to ToUpperInvariant () break compatibility on unix-like file systems. [8831] 20090923083851P</guid></item><item><title>Created Issue: ImportMany error fails silently [8830]</title><link>http://mef.codeplex.com/WorkItem/View.aspx?WorkItemId=8830</link><description>Situation&amp;#58;&lt;br /&gt;You have a class A with an ImportMany of contract type X.  Another class B that exports contract type X also has an Import of contract type Y &amp;#40;not an ImportMany, just an Import&amp;#41;.  There is no one that exports contract type Y.&lt;br /&gt;&lt;br /&gt;I would expect this situation to throw a CompositionException, but instead the ImportMany-of-contract-X in class A is simply missing class B with no error given.  In debugging this issue, I was unfamiliar with class B &amp;#40;and didn&amp;#39;t know at first that it was Import&amp;#39;ing anything&amp;#41; and it therefore took me a long time to debug the issue, whereas a CompositionException would have pointed me to the cause immediately.  I can&amp;#39;t think of a situation where a silent failure of any Import of cardinality 1 would be preferable to a CompositionException, even if that failed Import is &amp;#34;hidden&amp;#34; under an ImportMany.  A failed cadinality-1 Import is a failure, regardless of where in the composition it happens.&lt;br /&gt;&lt;br /&gt;This is with preview 6.&lt;br /&gt;</description><author>ccrain</author><pubDate>Wed, 23 Sep 2009 15:34:53 GMT</pubDate><guid isPermaLink="false">Created Issue: ImportMany error fails silently [8830] 20090923033453P</guid></item><item><title>Created Issue: RecursiveDirectoryCatalog</title><link>http://mef.codeplex.com/WorkItem/View.aspx?WorkItemId=8643</link><description>Could it be possible to add a recursive option to DirectoryCatalog&amp;#63; Or can you just make the following method protected in order to permit us to re-implement it&amp;#63;&lt;br /&gt;private string&amp;#91;&amp;#93; GetFiles&amp;#40;&amp;#41;&lt;br /&gt;</description><author>SandRock</author><pubDate>Mon, 31 Aug 2009 15:52:30 GMT</pubDate><guid isPermaLink="false">Created Issue: RecursiveDirectoryCatalog 20090831035230P</guid></item><item><title>Commented Issue: Allow the updating of MEF extension during runtime of the app</title><link>http://mef.codeplex.com/WorkItem/View.aspx?WorkItemId=8562</link><description>In its current form MEF locks the extension files after they&amp;#39;ve been loaded. This means that the extension can not be updated during runtime of the application. In a future version of MEF I would like to see an optional feature which would allow to load the extensions without locking them.&lt;br /&gt;Comments: ** Comment from web user: BillL ** &lt;p&gt;Here is a custom MEF that will do just that. Be sure to read this thread before using it&amp;#58; http&amp;#58;&amp;#47;&amp;#47;mef.codeplex.com&amp;#47;Thread&amp;#47;View.aspx&amp;#63;ThreadId&amp;#61;65227&lt;/p&gt;</description><author>BillL</author><pubDate>Mon, 31 Aug 2009 13:01:11 GMT</pubDate><guid isPermaLink="false">Commented Issue: Allow the updating of MEF extension during runtime of the app 20090831010111P</guid></item><item><title>Commented Issue: If a base class has an import that fails the exception does not give the right reason</title><link>http://mef.codeplex.com/WorkItem/View.aspx?WorkItemId=8492</link><description>In the code below the test fails until you un-comment on the line &amp;#34;var typeCatalog &amp;#61; new TypeCatalog&amp;#40;typeof&amp;#40;Foo&amp;#41;&amp;#41;&amp;#59;&amp;#47;&amp;#47;, typeof&amp;#40;Bar&amp;#41;&amp;#41;&amp;#59;&amp;#34;. Then the test works.&lt;br /&gt;&lt;br /&gt;FooImporter is a class that imports Foo. The Foo has a base class FooBase. FooBase has an import on IBar. The contract IBar is not possible to satisfy without the type Bar that exports the contract IBar.&lt;br /&gt;&lt;br /&gt;If I try to satisfy imports on Foo without the container knowing Bar the error reported is not that an IBar Export is missing. The error is that IFoo is missing which it technically is not. It is present but has a child that is missing.&lt;br /&gt;&lt;br /&gt;On the other hand if you try to satisfy imports on the Foo class direct the error shows that IBar is missing &amp;#40;second test&amp;#41;.&lt;br /&gt;&lt;br /&gt;As I see it there is a break in the error reporting causing the erroneous assumption that IFoo is missing when it is IBar that is missing. But only when Foo is not the root of the graph satisfied by MEF.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;M.&lt;br /&gt;&lt;br /&gt;&amp;#91;TestClass&amp;#93;&lt;br /&gt;public class MEFBadBaseImportTests&lt;br /&gt;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#91;TestMethod&amp;#93;&lt;br /&gt;&amp;#9;public void Bad_base_class_messes_up_the_error_message&amp;#40;&amp;#41;&lt;br /&gt;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;var typeCatalog &amp;#61; new TypeCatalog&amp;#40;typeof&amp;#40;Foo&amp;#41;&amp;#41;&amp;#59;&amp;#47;&amp;#47;, typeof&amp;#40;Bar&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;var compositionContainer &amp;#61; new CompositionContainer&amp;#40;typeCatalog&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#9;var fooImporter &amp;#61; new FooImporter&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#9;try&lt;br /&gt;&amp;#9;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;compositionContainer.SatisfyImportsOnce&amp;#40;fooImporter&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#125;&lt;br /&gt;&amp;#9;&amp;#9;catch &amp;#40;CompositionException ce&amp;#41;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;var stringBuilder &amp;#61; new StringBuilder&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;&amp;#34;Message&amp;#58;&amp;#34;&amp;#41;.AppendLine&amp;#40;ce.Message&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;new string&amp;#40;&amp;#39;&amp;#42;&amp;#39;, 42&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;foreach &amp;#40;var error in ce.Errors&amp;#41;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;&amp;#34;Error&amp;#58;&amp;#34;&amp;#41;.AppendLine&amp;#40;error.Exception.Message&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;new string&amp;#40;&amp;#39;&amp;#42;&amp;#39;, 42&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#125;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;Assert.Fail&amp;#40;stringBuilder.ToString&amp;#40;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#9;Assert.IsNotNull&amp;#40;fooImporter.Foo&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#91;TestMethod&amp;#93;&lt;br /&gt;&amp;#9;public void Using_the_class_direct_shows_the_correct_error&amp;#40;&amp;#41;&lt;br /&gt;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;var typeCatalog &amp;#61; new TypeCatalog&amp;#40;typeof&amp;#40;Foo&amp;#41;&amp;#41;&amp;#59;&amp;#47;&amp;#47;, typeof&amp;#40;Bar&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;var compositionContainer &amp;#61; new CompositionContainer&amp;#40;typeCatalog&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#9;var foo &amp;#61; new Foo&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#9;try&lt;br /&gt;&amp;#9;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;compositionContainer.SatisfyImportsOnce&amp;#40;foo&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#125;&lt;br /&gt;&amp;#9;&amp;#9;catch &amp;#40;CompositionException ce&amp;#41;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;var stringBuilder &amp;#61; new StringBuilder&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;&amp;#34;Message&amp;#58;&amp;#34;&amp;#41;.AppendLine&amp;#40;ce.Message&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;new string&amp;#40;&amp;#39;&amp;#42;&amp;#39;, 42&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;foreach &amp;#40;var error in ce.Errors&amp;#41;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;&amp;#34;Error&amp;#58;&amp;#34;&amp;#41;.AppendLine&amp;#40;error.Exception.Message&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;new string&amp;#40;&amp;#39;&amp;#42;&amp;#39;, 42&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#125;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;Assert.Fail&amp;#40;stringBuilder.ToString&amp;#40;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#9;Assert.IsNotNull&amp;#40;foo.Bar&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;public interface IFoo &amp;#123; &amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;public interface IBar &amp;#123; &amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;public abstract class FooBase &amp;#58; IFoo&lt;br /&gt;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#91;Import&amp;#93;&lt;br /&gt;&amp;#9;&amp;#9;public IBar Bar &amp;#123; get&amp;#59; set&amp;#59; &amp;#125;&lt;br /&gt;&amp;#9;&amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#91;Export&amp;#40;typeof&amp;#40;IFoo&amp;#41;&amp;#41;&amp;#93;&lt;br /&gt;&amp;#9;public class Foo &amp;#58; FooBase&lt;br /&gt;&amp;#9;&amp;#123; &amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#91;Export&amp;#40;typeof&amp;#40;IBar&amp;#41;&amp;#41;&amp;#93;&lt;br /&gt;&amp;#9;public class Bar &amp;#58; IBar &amp;#123; &amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;public class FooImporter&lt;br /&gt;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#91;Import&amp;#93;&lt;br /&gt;&amp;#9;&amp;#9;public IFoo Foo &amp;#123; get&amp;#59; set&amp;#59; &amp;#125;&lt;br /&gt;&amp;#9;&amp;#125;&lt;br /&gt;&amp;#125;&lt;br /&gt;Comments: ** Comment from web user: nblumhardt ** &lt;p&gt;Thanks for reporting this BTW.&lt;/p&gt;</description><author>nblumhardt</author><pubDate>Thu, 27 Aug 2009 22:03:30 GMT</pubDate><guid isPermaLink="false">Commented Issue: If a base class has an import that fails the exception does not give the right reason 20090827100330P</guid></item><item><title>Commented Issue: If a base class has an import that fails the exception does not give the right reason</title><link>http://mef.codeplex.com/WorkItem/View.aspx?WorkItemId=8492</link><description>In the code below the test fails until you un-comment on the line &amp;#34;var typeCatalog &amp;#61; new TypeCatalog&amp;#40;typeof&amp;#40;Foo&amp;#41;&amp;#41;&amp;#59;&amp;#47;&amp;#47;, typeof&amp;#40;Bar&amp;#41;&amp;#41;&amp;#59;&amp;#34;. Then the test works.&lt;br /&gt;&lt;br /&gt;FooImporter is a class that imports Foo. The Foo has a base class FooBase. FooBase has an import on IBar. The contract IBar is not possible to satisfy without the type Bar that exports the contract IBar.&lt;br /&gt;&lt;br /&gt;If I try to satisfy imports on Foo without the container knowing Bar the error reported is not that an IBar Export is missing. The error is that IFoo is missing which it technically is not. It is present but has a child that is missing.&lt;br /&gt;&lt;br /&gt;On the other hand if you try to satisfy imports on the Foo class direct the error shows that IBar is missing &amp;#40;second test&amp;#41;.&lt;br /&gt;&lt;br /&gt;As I see it there is a break in the error reporting causing the erroneous assumption that IFoo is missing when it is IBar that is missing. But only when Foo is not the root of the graph satisfied by MEF.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;M.&lt;br /&gt;&lt;br /&gt;&amp;#91;TestClass&amp;#93;&lt;br /&gt;public class MEFBadBaseImportTests&lt;br /&gt;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#91;TestMethod&amp;#93;&lt;br /&gt;&amp;#9;public void Bad_base_class_messes_up_the_error_message&amp;#40;&amp;#41;&lt;br /&gt;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;var typeCatalog &amp;#61; new TypeCatalog&amp;#40;typeof&amp;#40;Foo&amp;#41;&amp;#41;&amp;#59;&amp;#47;&amp;#47;, typeof&amp;#40;Bar&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;var compositionContainer &amp;#61; new CompositionContainer&amp;#40;typeCatalog&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#9;var fooImporter &amp;#61; new FooImporter&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#9;try&lt;br /&gt;&amp;#9;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;compositionContainer.SatisfyImportsOnce&amp;#40;fooImporter&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#125;&lt;br /&gt;&amp;#9;&amp;#9;catch &amp;#40;CompositionException ce&amp;#41;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;var stringBuilder &amp;#61; new StringBuilder&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;&amp;#34;Message&amp;#58;&amp;#34;&amp;#41;.AppendLine&amp;#40;ce.Message&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;new string&amp;#40;&amp;#39;&amp;#42;&amp;#39;, 42&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;foreach &amp;#40;var error in ce.Errors&amp;#41;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;&amp;#34;Error&amp;#58;&amp;#34;&amp;#41;.AppendLine&amp;#40;error.Exception.Message&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;new string&amp;#40;&amp;#39;&amp;#42;&amp;#39;, 42&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#125;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;Assert.Fail&amp;#40;stringBuilder.ToString&amp;#40;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#9;Assert.IsNotNull&amp;#40;fooImporter.Foo&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#91;TestMethod&amp;#93;&lt;br /&gt;&amp;#9;public void Using_the_class_direct_shows_the_correct_error&amp;#40;&amp;#41;&lt;br /&gt;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;var typeCatalog &amp;#61; new TypeCatalog&amp;#40;typeof&amp;#40;Foo&amp;#41;&amp;#41;&amp;#59;&amp;#47;&amp;#47;, typeof&amp;#40;Bar&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;var compositionContainer &amp;#61; new CompositionContainer&amp;#40;typeCatalog&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#9;var foo &amp;#61; new Foo&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#9;try&lt;br /&gt;&amp;#9;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;compositionContainer.SatisfyImportsOnce&amp;#40;foo&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#125;&lt;br /&gt;&amp;#9;&amp;#9;catch &amp;#40;CompositionException ce&amp;#41;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;var stringBuilder &amp;#61; new StringBuilder&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;&amp;#34;Message&amp;#58;&amp;#34;&amp;#41;.AppendLine&amp;#40;ce.Message&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;new string&amp;#40;&amp;#39;&amp;#42;&amp;#39;, 42&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;foreach &amp;#40;var error in ce.Errors&amp;#41;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;&amp;#34;Error&amp;#58;&amp;#34;&amp;#41;.AppendLine&amp;#40;error.Exception.Message&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;new string&amp;#40;&amp;#39;&amp;#42;&amp;#39;, 42&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#125;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;Assert.Fail&amp;#40;stringBuilder.ToString&amp;#40;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#9;Assert.IsNotNull&amp;#40;foo.Bar&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;public interface IFoo &amp;#123; &amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;public interface IBar &amp;#123; &amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;public abstract class FooBase &amp;#58; IFoo&lt;br /&gt;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#91;Import&amp;#93;&lt;br /&gt;&amp;#9;&amp;#9;public IBar Bar &amp;#123; get&amp;#59; set&amp;#59; &amp;#125;&lt;br /&gt;&amp;#9;&amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#91;Export&amp;#40;typeof&amp;#40;IFoo&amp;#41;&amp;#41;&amp;#93;&lt;br /&gt;&amp;#9;public class Foo &amp;#58; FooBase&lt;br /&gt;&amp;#9;&amp;#123; &amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#91;Export&amp;#40;typeof&amp;#40;IBar&amp;#41;&amp;#41;&amp;#93;&lt;br /&gt;&amp;#9;public class Bar &amp;#58; IBar &amp;#123; &amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;public class FooImporter&lt;br /&gt;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#91;Import&amp;#93;&lt;br /&gt;&amp;#9;&amp;#9;public IFoo Foo &amp;#123; get&amp;#59; set&amp;#59; &amp;#125;&lt;br /&gt;&amp;#9;&amp;#125;&lt;br /&gt;&amp;#125;&lt;br /&gt;Comments: ** Comment from web user: nblumhardt ** &lt;p&gt;This behaviour is deliberate, although it may not be expected. This is a side-effect of Stable Composition - there are some diagnostic tools described at http&amp;#58;&amp;#47;&amp;#47;blogs.msdn.com&amp;#47;nblumhardt&amp;#47;archive&amp;#47;2009&amp;#47;07&amp;#47;09&amp;#47;mef-preview-6-available.aspx that may help.&lt;/p&gt;&lt;p&gt;Post .NET 4 we will consider how this error reporting might be improved.&lt;/p&gt;</description><author>nblumhardt</author><pubDate>Thu, 27 Aug 2009 22:01:36 GMT</pubDate><guid isPermaLink="false">Commented Issue: If a base class has an import that fails the exception does not give the right reason 20090827100136P</guid></item><item><title>Created Issue: Allow the updating of MEF extension during runtime of the app</title><link>http://mef.codeplex.com/WorkItem/View.aspx?WorkItemId=8562</link><description>In its current form MEF locks the extension files after they&amp;#39;ve been loaded. This means that the extension can not be updated during runtime of the application. In a future version of MEF I would like to see an optional feature which would allow to load the extensions without locking them.&lt;br /&gt;</description><author>Miksu</author><pubDate>Thu, 20 Aug 2009 07:06:00 GMT</pubDate><guid isPermaLink="false">Created Issue: Allow the updating of MEF extension during runtime of the app 20090820070600A</guid></item><item><title>Created Issue: If a base class has an import that fails the exception does not give the right reason</title><link>http://mef.codeplex.com/WorkItem/View.aspx?WorkItemId=8492</link><description>In the code below the test fails until you un-comment on the line &amp;#34;var typeCatalog &amp;#61; new TypeCatalog&amp;#40;typeof&amp;#40;Foo&amp;#41;&amp;#41;&amp;#59;&amp;#47;&amp;#47;, typeof&amp;#40;Bar&amp;#41;&amp;#41;&amp;#59;&amp;#34;. Then the test works.&lt;br /&gt;&lt;br /&gt;FooImporter is a class that imports Foo. The Foo has a base class FooBase. FooBase has an import on IBar. The contract IBar is not possible to satisfy without the type Bar that exports the contract IBar.&lt;br /&gt;&lt;br /&gt;If I try to satisfy imports on Foo without the container knowing Bar the error reported is not that an IBar Export is missing. The error is that IFoo is missing which it technically is not. It is present but has a child that is missing.&lt;br /&gt;&lt;br /&gt;On the other hand if you try to satisfy imports on the Foo class direct the error shows that IBar is missing &amp;#40;second test&amp;#41;.&lt;br /&gt;&lt;br /&gt;As I see it there is a break in the error reporting causing the erroneous assumption that IFoo is missing when it is IBar that is missing. But only when Foo is not the root of the graph satisfied by MEF.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;M.&lt;br /&gt;&lt;br /&gt;&amp;#91;TestClass&amp;#93;&lt;br /&gt;public class MEFBadBaseImportTests&lt;br /&gt;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#91;TestMethod&amp;#93;&lt;br /&gt;&amp;#9;public void Bad_base_class_messes_up_the_error_message&amp;#40;&amp;#41;&lt;br /&gt;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;var typeCatalog &amp;#61; new TypeCatalog&amp;#40;typeof&amp;#40;Foo&amp;#41;&amp;#41;&amp;#59;&amp;#47;&amp;#47;, typeof&amp;#40;Bar&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;var compositionContainer &amp;#61; new CompositionContainer&amp;#40;typeCatalog&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#9;var fooImporter &amp;#61; new FooImporter&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#9;try&lt;br /&gt;&amp;#9;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;compositionContainer.SatisfyImportsOnce&amp;#40;fooImporter&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#125;&lt;br /&gt;&amp;#9;&amp;#9;catch &amp;#40;CompositionException ce&amp;#41;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;var stringBuilder &amp;#61; new StringBuilder&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;&amp;#34;Message&amp;#58;&amp;#34;&amp;#41;.AppendLine&amp;#40;ce.Message&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;new string&amp;#40;&amp;#39;&amp;#42;&amp;#39;, 42&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;foreach &amp;#40;var error in ce.Errors&amp;#41;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;&amp;#34;Error&amp;#58;&amp;#34;&amp;#41;.AppendLine&amp;#40;error.Exception.Message&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;new string&amp;#40;&amp;#39;&amp;#42;&amp;#39;, 42&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#125;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;Assert.Fail&amp;#40;stringBuilder.ToString&amp;#40;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#9;Assert.IsNotNull&amp;#40;fooImporter.Foo&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#91;TestMethod&amp;#93;&lt;br /&gt;&amp;#9;public void Using_the_class_direct_shows_the_correct_error&amp;#40;&amp;#41;&lt;br /&gt;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;var typeCatalog &amp;#61; new TypeCatalog&amp;#40;typeof&amp;#40;Foo&amp;#41;&amp;#41;&amp;#59;&amp;#47;&amp;#47;, typeof&amp;#40;Bar&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;var compositionContainer &amp;#61; new CompositionContainer&amp;#40;typeCatalog&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#9;var foo &amp;#61; new Foo&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#9;try&lt;br /&gt;&amp;#9;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;compositionContainer.SatisfyImportsOnce&amp;#40;foo&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#125;&lt;br /&gt;&amp;#9;&amp;#9;catch &amp;#40;CompositionException ce&amp;#41;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;var stringBuilder &amp;#61; new StringBuilder&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;&amp;#34;Message&amp;#58;&amp;#34;&amp;#41;.AppendLine&amp;#40;ce.Message&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;new string&amp;#40;&amp;#39;&amp;#42;&amp;#39;, 42&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;foreach &amp;#40;var error in ce.Errors&amp;#41;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;&amp;#34;Error&amp;#58;&amp;#34;&amp;#41;.AppendLine&amp;#40;error.Exception.Message&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#9;stringBuilder.AppendLine&amp;#40;new string&amp;#40;&amp;#39;&amp;#42;&amp;#39;, 42&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;&amp;#125;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#9;Assert.Fail&amp;#40;stringBuilder.ToString&amp;#40;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#9;Assert.IsNotNull&amp;#40;foo.Bar&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;public interface IFoo &amp;#123; &amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;public interface IBar &amp;#123; &amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;public abstract class FooBase &amp;#58; IFoo&lt;br /&gt;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#91;Import&amp;#93;&lt;br /&gt;&amp;#9;&amp;#9;public IBar Bar &amp;#123; get&amp;#59; set&amp;#59; &amp;#125;&lt;br /&gt;&amp;#9;&amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#91;Export&amp;#40;typeof&amp;#40;IFoo&amp;#41;&amp;#41;&amp;#93;&lt;br /&gt;&amp;#9;public class Foo &amp;#58; FooBase&lt;br /&gt;&amp;#9;&amp;#123; &amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#91;Export&amp;#40;typeof&amp;#40;IBar&amp;#41;&amp;#41;&amp;#93;&lt;br /&gt;&amp;#9;public class Bar &amp;#58; IBar &amp;#123; &amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;public class FooImporter&lt;br /&gt;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#91;Import&amp;#93;&lt;br /&gt;&amp;#9;&amp;#9;public IFoo Foo &amp;#123; get&amp;#59; set&amp;#59; &amp;#125;&lt;br /&gt;&amp;#9;&amp;#125;&lt;br /&gt;&amp;#125;&lt;br /&gt;</description><author>NoopMan</author><pubDate>Thu, 13 Aug 2009 20:59:23 GMT</pubDate><guid isPermaLink="false">Created Issue: If a base class has an import that fails the exception does not give the right reason 20090813085923P</guid></item><item><title>Closed Issue: Add AllowPartiallyTrustedCallersAttribute to System.ComponentModel.Composition</title><link>http://mef.codeplex.com/WorkItem/View.aspx?WorkItemId=8330</link><description>Hello,&lt;br /&gt;&lt;br /&gt;AllowPartiallyTrustedCallersAttribute should be applied to System.ComponentModel.Composition to allow composition to work in partially trusted environments.&lt;br /&gt;I have a fully-trusted assembly loading plugins. Policies have been applied to the AppDomain so that plugins run under a very limited set of permissions, including ReflectionPermissionFlag.RestrictedMemberAccess so they can use reflection on themselves but not on the fully-trusted assembly. These plugins are exported using the classical MEF ExportAttribute.&lt;br /&gt;&lt;br /&gt;However, since AllowPartiallyTrustedCallers is not applied to the MEF assembly, every MEF attribute such as ExportAttribute, PartCreationPolicyAttribute, etc are not present when calling GetCustomAttributes&amp;#40;&amp;#41; on exported types. The result is that MEF see no export at all, and composition fails. Recompiling System.ComponentModel.Composition with &amp;#91;attribute&amp;#58; AllowPartiallyTrustedCallers&amp;#93; automatically solves this problem, but it&amp;#39;ll be nice if we didn&amp;#39;t have to do this, since this assembly will be part of .NET Framework 4.0. I think my scenario is pretty common to be considered.&lt;br /&gt;&lt;br /&gt;Thanks&amp;#33;&lt;br /&gt;Comments: &lt;p&gt;Aptca is applied to our shipped binary &amp;#40;not codeplex&amp;#41;&lt;/p&gt;</description><author>haveriss</author><pubDate>Fri, 07 Aug 2009 17:20:26 GMT</pubDate><guid isPermaLink="false">Closed Issue: Add AllowPartiallyTrustedCallersAttribute to System.ComponentModel.Composition 20090807052026P</guid></item><item><title>Commented Issue: Add AllowPartiallyTrustedCallersAttribute to System.ComponentModel.Composition</title><link>http://mef.codeplex.com/WorkItem/View.aspx?WorkItemId=8330</link><description>Hello,&lt;br /&gt;&lt;br /&gt;AllowPartiallyTrustedCallersAttribute should be applied to System.ComponentModel.Composition to allow composition to work in partially trusted environments.&lt;br /&gt;I have a fully-trusted assembly loading plugins. Policies have been applied to the AppDomain so that plugins run under a very limited set of permissions, including ReflectionPermissionFlag.RestrictedMemberAccess so they can use reflection on themselves but not on the fully-trusted assembly. These plugins are exported using the classical MEF ExportAttribute.&lt;br /&gt;&lt;br /&gt;However, since AllowPartiallyTrustedCallers is not applied to the MEF assembly, every MEF attribute such as ExportAttribute, PartCreationPolicyAttribute, etc are not present when calling GetCustomAttributes&amp;#40;&amp;#41; on exported types. The result is that MEF see no export at all, and composition fails. Recompiling System.ComponentModel.Composition with &amp;#91;attribute&amp;#58; AllowPartiallyTrustedCallers&amp;#93; automatically solves this problem, but it&amp;#39;ll be nice if we didn&amp;#39;t have to do this, since this assembly will be part of .NET Framework 4.0. I think my scenario is pretty common to be considered.&lt;br /&gt;&lt;br /&gt;Thanks&amp;#33;&lt;br /&gt;Comments: ** Comment from web user: haveriss ** &lt;p&gt;Hi, I dont think we will apply APTCA to our codeplex release. That said, the MEF version shipped with .net 4.0 has aptca applied. &lt;br /&gt;Thanks&lt;/p&gt;</description><author>haveriss</author><pubDate>Fri, 07 Aug 2009 17:20:01 GMT</pubDate><guid isPermaLink="false">Commented Issue: Add AllowPartiallyTrustedCallersAttribute to System.ComponentModel.Composition 20090807052001P</guid></item><item><title>Closed Issue: ImportMany child failing composition does not throw</title><link>http://mef.codeplex.com/WorkItem/View.aspx?WorkItemId=8122</link><description>In MEF Preview 6&amp;#58; If you &amp;#91;ImportMany&amp;#93; and one of the &amp;#39;children&amp;#39; that get imported is impossible to satisfy imports on you won&amp;#39;t get an exception from MEF. Instead it tells you the collection does not contain the instance.&lt;br /&gt;&lt;br /&gt;In MEF Preview 5&amp;#58; You get one instance of the Export and when you do GetExportedObject&amp;#40;&amp;#41; you get an exception.&lt;br /&gt;&lt;br /&gt;I prefer the old functionality from MEF Preview 5&amp;#58; The Export is found but when instantiated it throws. Now instead we get a collection that does not contain an import that does exist but has an error.&lt;br /&gt;&lt;br /&gt;Is this new behavior intentional or is this a bug&amp;#63;&lt;br /&gt;&lt;br /&gt;Below is a test class with a test and some comment code on how to repeat our finding. 1&amp;#41; Run the test. 2&amp;#41; Comment out the &amp;#91;Import&amp;#93; attribute on Foo.Bar and run the test again.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Magnus and Peter&lt;br /&gt;&lt;br /&gt;&amp;#91;TestClass&amp;#93;&lt;br /&gt;public class MEFTests&lt;br /&gt;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#91;ImportMany&amp;#93;&lt;br /&gt;&amp;#9;public IEnumerable&amp;#60;Lazy&amp;#60;IFoo, IFooMetaData&amp;#62;&amp;#62; TestMetadata &amp;#123; get&amp;#59; set&amp;#59; &amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;public interface IFoo &amp;#123; &amp;#125;&lt;br /&gt;&amp;#9;public interface IFooMetaData &amp;#123; string Foo &amp;#123; get&amp;#59; &amp;#125; &amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#47;&amp;#47; Note&amp;#58; There is nothing that &amp;#91;Export&amp;#93;s IBar only an &amp;#91;Import&amp;#93; below&lt;br /&gt;&amp;#9;public interface IBar &amp;#123; &amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#91;Export&amp;#40;typeof&amp;#40;IFoo&amp;#41;&amp;#41;, &lt;br /&gt;&amp;#9; ExportMetadata&amp;#40;&amp;#34;Foo&amp;#34;, &amp;#34;bar&amp;#34;&amp;#41;&amp;#93;&lt;br /&gt;&amp;#9;public class Foo &amp;#58; IFoo&lt;br /&gt;&amp;#9;&amp;#123;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#91;Import&amp;#93;&lt;br /&gt;&amp;#9;&amp;#9;public IBar Bar &amp;#123; get&amp;#59; set&amp;#59; &amp;#125;&lt;br /&gt;&amp;#9;&amp;#125;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#91;TestMethod&amp;#93;&lt;br /&gt;&amp;#9;public void ImportMany_child_failing_composition_does_not_throw&amp;#40;&amp;#41;&lt;br /&gt;  &amp;#123;&lt;br /&gt;    var typeCatalog &amp;#61; new TypeCatalog&amp;#40;typeof&amp;#40;MEFTests&amp;#41;, typeof&amp;#40;Foo&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;    var container &amp;#61; new CompositionContainer&amp;#40;typeCatalog&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#47;&amp;#47; I would expect the next line to throw because Foo&amp;#39;s dependency on IBar cannot be resolved in MEF.&lt;br /&gt;    container.SatisfyImportsOnce&amp;#40;this&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#47;&amp;#47; However it does not throw but rather gives me an empty collection.&lt;br /&gt;&amp;#9;&amp;#9;&amp;#47;&amp;#47; Which causes the following Assert to fail.&lt;br /&gt;&lt;br /&gt;    Assert.AreEqual&amp;#40;1, TestMetadata.Count&amp;#40;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;IFoo value &amp;#61; TestMetadata.First&amp;#40;&amp;#41;.Value&amp;#59;&lt;br /&gt;&amp;#9;&amp;#9;Assert.IsNotNull&amp;#40;value&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#47;&amp;#47; Finally comment out the &amp;#91;Import&amp;#93; on Foo.Bar and run the test again.&lt;br /&gt;&amp;#9;&amp;#9;&amp;#47;&amp;#47; The test now succeeeds&amp;#33;&lt;br /&gt;  &amp;#125;&lt;br /&gt;&amp;#125;&lt;br /&gt;Comments: &lt;p&gt;This is by design - see&amp;#58; http&amp;#58;&amp;#47;&amp;#47;blogs.msdn.com&amp;#47;nblumhardt&amp;#47;archive&amp;#47;2009&amp;#47;07&amp;#47;17&amp;#47;light-up-or-mef-optional-exports.aspx&lt;/p&gt;&lt;p&gt;Thanks for raising this though. If you need any help working with this behaviour feel free to post on the discussion group.&lt;/p&gt;</description><author>nblumhardt</author><pubDate>Fri, 07 Aug 2009 16:56:56 GMT</pubDate><guid isPermaLink="false">Closed Issue: ImportMany child failing composition does not throw 20090807045656P</guid></item><item><title>Commented Issue: Add AllowPartiallyTrustedCallersAttribute to System.ComponentModel.Composition</title><link>http://mef.codeplex.com/WorkItem/View.aspx?WorkItemId=8330</link><description>Hello,&lt;br /&gt;&lt;br /&gt;AllowPartiallyTrustedCallersAttribute should be applied to System.ComponentModel.Composition to allow composition to work in partially trusted environments.&lt;br /&gt;I have a fully-trusted assembly loading plugins. Policies have been applied to the AppDomain so that plugins run under a very limited set of permissions, including ReflectionPermissionFlag.RestrictedMemberAccess so they can use reflection on themselves but not on the fully-trusted assembly. These plugins are exported using the classical MEF ExportAttribute.&lt;br /&gt;&lt;br /&gt;However, since AllowPartiallyTrustedCallers is not applied to the MEF assembly, every MEF attribute such as ExportAttribute, PartCreationPolicyAttribute, etc are not present when calling GetCustomAttributes&amp;#40;&amp;#41; on exported types. The result is that MEF see no export at all, and composition fails. Recompiling System.ComponentModel.Composition with &amp;#91;attribute&amp;#58; AllowPartiallyTrustedCallers&amp;#93; automatically solves this problem, but it&amp;#39;ll be nice if we didn&amp;#39;t have to do this, since this assembly will be part of .NET Framework 4.0. I think my scenario is pretty common to be considered.&lt;br /&gt;&lt;br /&gt;Thanks&amp;#33;&lt;br /&gt;Comments: ** Comment from web user: nblumhardt ** &lt;p&gt;Thanks for reporting this, we&amp;#39;ll look into your scenario.&lt;/p&gt;</description><author>nblumhardt</author><pubDate>Fri, 07 Aug 2009 16:53:19 GMT</pubDate><guid isPermaLink="false">Commented Issue: Add AllowPartiallyTrustedCallersAttribute to System.ComponentModel.Composition 20090807045319P</guid></item><item><title>Created Issue: Add AllowPartiallyTrustedCallersAttribute to System.ComponentModel.Composition</title><link>http://mef.codeplex.com/WorkItem/View.aspx?WorkItemId=8330</link><description>Hello,&lt;br /&gt;&lt;br /&gt;AllowPartiallyTrustedCallersAttribute should be applied to System.ComponentModel.Composition to allow composition to work in partially trusted environments.&lt;br /&gt;I have a fully-trusted assembly loading plugins. Policies have been applied to the AppDomain so that plugins run under a very limited set of permissions, including ReflectionPermissionFlag.RestrictedMemberAccess so they can use reflection on themselves but not on the fully-trusted assembly. These plugins are exported using the classical MEF ExportAttribute.&lt;br /&gt;&lt;br /&gt;However, since AllowPartiallyTrustedCallers is not applied to the MEF assembly, every MEF attribute such as ExportAttribute, PartCreationPolicyAttribute, etc are not present when calling GetCustomAttributes&amp;#40;&amp;#41; on exported types. The result is that MEF see no export at all, and composition fails. Recompiling System.ComponentModel.Composition with &amp;#91;attribute&amp;#58; AllowPartiallyTrustedCallers&amp;#93; automatically solves this problem, but it&amp;#39;ll be nice if we didn&amp;#39;t have to do this, since this assembly will be part of .NET Framework 4.0. I think my scenario is pretty common to be considered.&lt;br /&gt;&lt;br /&gt;Thanks&amp;#33;&lt;br /&gt;</description><author>MrJul</author><pubDate>Wed, 05 Aug 2009 10:04:25 GMT</pubDate><guid isPermaLink="false">Created Issue: Add AllowPartiallyTrustedCallersAttribute to System.ComponentModel.Composition 20090805100425A</guid></item><item><title>Created Issue: Add support for filtered and projected imports</title><link>http://mef.codeplex.com/WorkItem/View.aspx?WorkItemId=8294</link><description>Hey guys, &lt;br /&gt;I have seen it now in a couple places that filtered imports would be a very handy thing to have. This is done manually by the DSL toolkit&amp;#47;ModelBus guys, as well as ourselves &amp;#40;as I showed Glenn last week&amp;#41;&lt;br /&gt;&lt;br /&gt;The current implementations &amp;#40;workaround&amp;#41; involves doing an ImportMany on some interface, and re-exporting the enumerable after applying some filter and&amp;#47;or transformation. &lt;br /&gt;&lt;br /&gt;For filter-only, I could see how having ImportManyAttribute-derived  classes would remove the need for these &amp;#34;man in the middle&amp;#34; class&amp;#58;&lt;br /&gt;&lt;br /&gt;&amp;#91;MyImportMany&amp;#40;Host&amp;#61;&amp;#34;VS&amp;#34;&amp;#41;&amp;#93;&lt;br /&gt;&lt;br /&gt;This attribute would receive a filter string, that would be applied against export metadata to filter out things that do not belong to the &amp;#34;VS&amp;#34; host &amp;#40;model bus has such a scenario&amp;#41;. You can see an example today in VS TeamArch in&amp;#58;&lt;br /&gt;Name&amp;#58;&amp;#9;Microsoft.VisualStudio.Modeling.Integration.CompositionConfigurationManager&lt;br /&gt;Assembly&amp;#58;&amp;#9;Microsoft.VisualStudio.Modeling.Sdk.Integration.10.0, Version&amp;#61;10.0.0.0&lt;br /&gt;&lt;br /&gt;the base ImportManyAttribute would just have a new member that would allow filtering&amp;#58;&lt;br /&gt;&lt;br /&gt;abstract class FilteredImportManyAttribute&amp;#60;T&amp;#62; &amp;#58; ImportManyAttribute&lt;br /&gt;&amp;#123;&lt;br /&gt;    protected abstract bool Filter&amp;#40;Lazy&amp;#60;T, IDictionary&amp;#60;string, object&amp;#62;&amp;#62; export&amp;#41;&amp;#59;&lt;br /&gt;&amp;#125;&lt;br /&gt;&lt;br /&gt;you could also provide another base class for typed metadata&amp;#58;&lt;br /&gt;&lt;br /&gt;abstract class FilteredImportManyAttribute&amp;#60;T, TMetadataView&amp;#62; &amp;#58; ImportManyAttribute&lt;br /&gt;&amp;#123;&lt;br /&gt;    protected abstract bool Filter&amp;#40;Lazy&amp;#60;T, TMetadataView&amp;#62; export&amp;#41;&amp;#59;&lt;br /&gt;&amp;#125;&lt;br /&gt;&lt;br /&gt;The base ImportManyAttribute would just return true for all exports, and provide the hook for the strong-typed derived attributes to hook into &amp;#40;doing the down casting of the export as necessary, etc.&amp;#41;.&lt;br /&gt;&lt;br /&gt;For transformations&amp;#47;projections you could apply the same principle, essencially having a SelectorImportManyAttribute &amp;#40;or something like that &amp;#59;&amp;#41;&amp;#41;&amp;#58;&lt;br /&gt;&lt;br /&gt;abstract class SelectorImportManyAttribute&amp;#60;TSource, TTarget&amp;#62; &amp;#58; ...&lt;br /&gt;&amp;#123;&lt;br /&gt;   protected abstract Lazy&amp;#60;TTarget&amp;#62; Select&amp;#40;Lazy&amp;#60;TSource&amp;#62; source&amp;#41;&amp;#59;&lt;br /&gt;&amp;#125;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;With this, I would be able to provide something like&amp;#58;&lt;br /&gt;&lt;br /&gt;&amp;#91;BusAdapterRegistrations&amp;#93;&lt;br /&gt;IEnumerable&amp;#60;IBusRegistration&amp;#62; Registrations &amp;#123; get&amp;#59; set&amp;#59; &amp;#125;&lt;br /&gt;&lt;br /&gt;the AdapterRegistrationsAttribute would actually be the adapter that transforms Lazy&amp;#60;ModelBusAdapter&amp;#62; to Lazy&amp;#60;IBusRegistration&amp;#62;, ready for the import. Yes, this may cause a proliferation of import-derived attributes, but I don&amp;#39;t think that&amp;#39;s a bad thing &amp;#40;the fact that you opened that in the first place is a good sign IMO&amp;#41;, as it gives domain-specific semantics to the generic import&amp;#47;export MEF mechanism. An end user wouldn&amp;#39;t need to know MEF core concepts to leverage it.&lt;br /&gt;</description><author>dcazzulino</author><pubDate>Sun, 02 Aug 2009 17:52:00 GMT</pubDate><guid isPermaLink="false">Created Issue: Add support for filtered and projected imports 20090802055200P</guid></item></channel></rss>