<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>MEFContrib Issue Tracker Rss Feed</title><link>http://www.codeplex.com/MEFContrib/WorkItem/List.aspx</link><description>MEFContrib Issue Tracker Rss Description</description><item><title>Reopened Issue: Provider Model - DefinitionProviderPartCatalog does not cache values unless aggregated [1943]</title><link>http://mefcontrib.codeplex.com/workitem/1943</link><description>The DefinitionProviderPartCatalog does not cache any parts unless it&amp;#39;s added to an AggregateCatalog first. This means that when the AddProviderPart metnod is called on the CompositionContainer it will fail with an exception. The reason for this is that the method will try to retreive a ProviderComposablePartDefinition for the object instance and the cache will be empty&amp;#33;&lt;br /&gt;</description><author>TheCodeJunkie</author><pubDate>Fri, 14 Jun 2013 07:15:30 GMT</pubDate><guid isPermaLink="false">Reopened Issue: Provider Model - DefinitionProviderPartCatalog does not cache values unless aggregated [1943] 20130614071530A</guid></item><item><title>Closed Issue: Provider Model - DefinitionProviderPartCatalog does not cache values unless aggregated [1943]</title><link>http://mefcontrib.codeplex.com/workitem/1943</link><description>The DefinitionProviderPartCatalog does not cache any parts unless it&amp;#39;s added to an AggregateCatalog first. This means that when the AddProviderPart metnod is called on the CompositionContainer it will fail with an exception. The reason for this is that the method will try to retreive a ProviderComposablePartDefinition for the object instance and the cache will be empty&amp;#33;&lt;br /&gt;</description><author>TheCodeJunkie</author><pubDate>Thu, 16 May 2013 09:39:41 GMT</pubDate><guid isPermaLink="false">Closed Issue: Provider Model - DefinitionProviderPartCatalog does not cache values unless aggregated [1943] 20130516093941A</guid></item><item><title>Commented Issue: Add Parameter to RegisterCatalog to add UNIQUE parts [10977]</title><link>http://mefcontrib.codeplex.com/workitem/10977</link><description>A suggestion that I believe would be beneficial to a lot of developers, would be to add the ability to register the parts of the Aggregate catalog, ignoring duplicates. &lt;br /&gt;&lt;br /&gt;The issue is, that when I register my exported parts, I get duplicate registrations for the same Export - leading me to the exception, &amp;#34;ImportCardinalityMismatchException&amp;#34;, when I try to Resolve&amp;#60;T&amp;#62;&amp;#40;&amp;#41;.&lt;br /&gt;&lt;br /&gt;There isn&amp;#39;t an easy work around that I have found and I believe it would be nice to have as part of this package. &lt;br /&gt;&lt;br /&gt;Code sample below&amp;#58;&lt;br /&gt;&lt;br /&gt;        private static void RegisterAssemblies&amp;#40;string assemblyPath, string searchPattern&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            string&amp;#91;&amp;#93; directories &amp;#61; Directory.GetDirectories&amp;#40;assemblyPath, &amp;#34;Debug&amp;#34;, SearchOption.AllDirectories&amp;#41;&amp;#59;&lt;br /&gt;            var exportedParts &amp;#61; new AggregateCatalog&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            foreach &amp;#40;string directory in directories&amp;#41;&lt;br /&gt;            &amp;#123;&lt;br /&gt;                var assemblyCatalog &amp;#61; new DirectoryCatalog&amp;#40;directory&amp;#41;&amp;#59;&lt;br /&gt;                exportedParts.Catalogs.Add&amp;#40;assemblyCatalog&amp;#41;&amp;#59;&lt;br /&gt;            &amp;#125;&lt;br /&gt;&lt;br /&gt;            _container.RegisterCatalog&amp;#40;exportedParts&amp;#41;&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;Comments: ** Comment from web user: montijr2007 ** &lt;p&gt;Here is what I believe would work- Add this to the UnityContainerExtensions source code for the &amp;#34;RegisterCatalog&amp;#34; method&amp;#58;&lt;/p&gt;&lt;p&gt;public static void RegisterCatalog&amp;#40;this IUnityContainer unityContainer, ComposablePartCatalog catalog&amp;#41;&lt;br /&gt;&amp;#123;&lt;br /&gt;      lock &amp;#40;unityContainer&amp;#41;&lt;br /&gt;      &amp;#123;&lt;br /&gt;           var compositionIntegration &amp;#61; EnableCompositionIntegration&amp;#40;unityContainer&amp;#41;&amp;#59;&lt;br /&gt;           compositionIntegration.Catalogs.Add&amp;#40;catalog&amp;#41;&amp;#59;&lt;/p&gt;&lt;p&gt;           IEnumerable&amp;#60;ComposablePartCatalog&amp;#62; parts &amp;#61; compositionIntegration.Catalogs.Distinct&amp;#40;&amp;#41;.ToList&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;          compositionIntegration.Catalogs.Clear&amp;#40;&amp;#41;&amp;#59;&lt;/p&gt;&lt;p&gt;           foreach &amp;#40;var part in parts&amp;#41;&lt;br /&gt;           &amp;#123;&lt;br /&gt;               compositionIntegration.Catalogs.Add&amp;#40;part&amp;#41;&amp;#59;&lt;br /&gt;           &amp;#125;&lt;/p&gt;&lt;p&gt;       &amp;#125;&lt;br /&gt; &amp;#125;&lt;/p&gt;</description><author>montijr2007</author><pubDate>Thu, 05 Jul 2012 18:53:48 GMT</pubDate><guid isPermaLink="false">Commented Issue: Add Parameter to RegisterCatalog to add UNIQUE parts [10977] 20120705065348P</guid></item><item><title>Created Issue: Add Parameter to RegisterCatalog to add UNIQUE parts [10977]</title><link>http://mefcontrib.codeplex.com/workitem/10977</link><description>A suggestion that I believe would be beneficial to a lot of developers, would be to add the ability to register the parts of the Aggregate catalog, ignoring duplicates. &lt;br /&gt;&lt;br /&gt;The issue is, that when I register my exported parts, I get duplicate registrations for the same Export - leading me to the exception, &amp;#34;ImportCardinalityMismatchException&amp;#34;, when I try to Resolve&amp;#60;T&amp;#62;&amp;#40;&amp;#41;.&lt;br /&gt;&lt;br /&gt;There isn&amp;#39;t an easy work around that I have found and I believe it would be nice to have as part of this package. &lt;br /&gt;&lt;br /&gt;Code sample below&amp;#58;&lt;br /&gt;&lt;br /&gt;        private static void RegisterAssemblies&amp;#40;string assemblyPath, string searchPattern&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            string&amp;#91;&amp;#93; directories &amp;#61; Directory.GetDirectories&amp;#40;assemblyPath, &amp;#34;Debug&amp;#34;, SearchOption.AllDirectories&amp;#41;&amp;#59;&lt;br /&gt;            var exportedParts &amp;#61; new AggregateCatalog&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            foreach &amp;#40;string directory in directories&amp;#41;&lt;br /&gt;            &amp;#123;&lt;br /&gt;                var assemblyCatalog &amp;#61; new DirectoryCatalog&amp;#40;directory&amp;#41;&amp;#59;&lt;br /&gt;                exportedParts.Catalogs.Add&amp;#40;assemblyCatalog&amp;#41;&amp;#59;&lt;br /&gt;            &amp;#125;&lt;br /&gt;&lt;br /&gt;            _container.RegisterCatalog&amp;#40;exportedParts&amp;#41;&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;</description><author>montijr2007</author><pubDate>Thu, 05 Jul 2012 17:10:24 GMT</pubDate><guid isPermaLink="false">Created Issue: Add Parameter to RegisterCatalog to add UNIQUE parts [10977] 20120705051024P</guid></item><item><title>Created Issue: Generic Export With Method Export [10747]</title><link>http://mefcontrib.codeplex.com/workitem/10747</link><description>Given this import&amp;#58;&lt;br /&gt;provider.GetExportedValues&amp;#60;Foo&amp;#60;int&amp;#62;&amp;#62;&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;This works&amp;#58;&lt;br /&gt;&amp;#91;Export&amp;#93;&lt;br /&gt;public class Foo&amp;#60;T&amp;#62;&lt;br /&gt;&amp;#123;&lt;br /&gt;    public void Blah&amp;#40;&amp;#41;&lt;br /&gt;    &amp;#123;&lt;br /&gt;    &amp;#125;&lt;br /&gt;&amp;#125;&lt;br /&gt;&amp;#40;Returns 1 export for Foo&amp;#60;int&amp;#62;&amp;#41;.&lt;br /&gt;&lt;br /&gt;This does not work&amp;#58;&lt;br /&gt;&amp;#91;Export&amp;#93;&lt;br /&gt;public class Foo&amp;#60;T&amp;#62;&lt;br /&gt;&amp;#123;&lt;br /&gt;    &amp;#91;Export&amp;#93;&lt;br /&gt;    public void Blah&amp;#40;&amp;#41;&lt;br /&gt;    &amp;#123;&lt;br /&gt;    &amp;#125;&lt;br /&gt;&amp;#125;&lt;br /&gt;&amp;#40;Returns 0 export for Foo&amp;#60;int&amp;#62;&amp;#41;&lt;br /&gt;&lt;br /&gt;I understand that the method export here seems pointless since it can&amp;#39;t possibly be imported with out-of-the-box catalogue, but this should be fine since I&amp;#39;ll be creating my own custom catalog to handle this method export. What i can&amp;#39;t understand is why Foo&amp;#60;int&amp;#62; does not return any export at all.&lt;br /&gt;</description><author>hendryluk</author><pubDate>Wed, 09 May 2012 07:11:35 GMT</pubDate><guid isPermaLink="false">Created Issue: Generic Export With Method Export [10747] 20120509071135A</guid></item><item><title>Created Issue: Add a strong name key to assemblies [10260]</title><link>http://mefcontrib.codeplex.com/workitem/10260</link><description>The assemblies available in the download cannot be used in solutions that are strong named.&lt;br /&gt;</description><author>rprimrose</author><pubDate>Sun, 29 Jan 2012 23:34:47 GMT</pubDate><guid isPermaLink="false">Created Issue: Add a strong name key to assemblies [10260] 20120129113447P</guid></item><item><title>Created Issue: Unity integration and registration names [9768]</title><link>http://mefcontrib.codeplex.com/workitem/9768</link><description>MefContrib has a bug when using registration names in Unity.&lt;br /&gt;It throws the ImportCardinalityMismatchException, because it ignores the registration names when creating the contract names.&lt;br /&gt;&lt;br /&gt;I have the following registrations in unity&amp;#58;&lt;br /&gt;&lt;br /&gt;container.RegisterType&amp;#60;IDataLayer&amp;#62;&amp;#40;new&lt;br /&gt;ContainerControlledLifetimeManager&amp;#40;&amp;#41;, new InjectionFactory&amp;#40;&lt;br /&gt;&amp;#40;container&amp;#41; &amp;#61;&amp;#62; DataLayerFactory.CreateSqlDataLayer&amp;#40;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;container.RegisterType&amp;#60;IDataLayer&amp;#62;&amp;#40;&amp;#34;Local&amp;#34;, new&lt;br /&gt;ContainerControlledLifetimeManager&amp;#40;&amp;#41;, new InjectionFactory&amp;#40;&lt;br /&gt;&amp;#40;container&amp;#41; &amp;#61;&amp;#62; DataLayerFactory.CreateLocalConfigurationDataLayer&amp;#40;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;And on my exported class it has an IDataLayer parameter on its constructor.&lt;br /&gt;&lt;br /&gt;I noticed that on PrivateFactoryExportProvider.GetExportsCore method it always gets the contract name by its contract type.&lt;br /&gt;&lt;br /&gt;Also the UnityContainerAdapter registers the contract name as the registration name, while contract names should be unique &amp;#40;which doesn&amp;#39;t happen with unity where the registration name must be unique&lt;br /&gt;to each type and not globally&amp;#41; and therefore should contain a namespace or something to identify uniquely the registration.&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve modified the project with the following changes&amp;#58;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;On PrivateFactoryExportProvider.GetExportsCore&amp;#58;&lt;br /&gt;&lt;br /&gt;protected override IEnumerable&amp;#60;Export&amp;#62; GetExportsCore&amp;#40;ImportDefinition&lt;br /&gt;definition, AtomicComposition atomicComposition&amp;#41;&lt;br /&gt;                       &amp;#123;&lt;br /&gt;                               if &amp;#40;definition.Cardinality &amp;#61;&amp;#61; ImportCardinality.ZeroOrMore&amp;#41;&lt;br /&gt;                               &amp;#123;&lt;br /&gt;                                       return from exportDefinition in this.ReadOnlyDefinitions&lt;br /&gt;                                                  let contractName &amp;#61; exportDefinition.ContractName &amp;#63;&amp;#63;&lt;br /&gt;AttributedModelServices.GetContractName&amp;#40;exportDefinition.ContractType&amp;#41;&lt;br /&gt;                                                  where contractName &amp;#61;&amp;#61; definition.ContractName&lt;br /&gt;                                                  select new Export&amp;#40;exportDefinition, &amp;#40;&amp;#41; &amp;#61;&amp;#62;&lt;br /&gt;exportDefinition.Factory&amp;#40;SourceProvider&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                               &amp;#125;&lt;br /&gt;&lt;br /&gt;                               return base.GetExportsCore&amp;#40;definition, atomicComposition&amp;#41;&amp;#59;&lt;br /&gt;                       &amp;#125;&lt;br /&gt;&lt;br /&gt;And on UnityContainerAdapter&amp;#58;&lt;br /&gt;&lt;br /&gt;public override void Initialize&amp;#40;&amp;#41;&lt;br /&gt;               &amp;#123;&lt;br /&gt;                       TypeRegistrationTrackerExtension.RegisterIfMissing&amp;#40;container&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                       var tracker &amp;#61; this.container.Configure&amp;#60;TypeRegistrationTrackerExtension&amp;#62;&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                       foreach &amp;#40;var entry in tracker.Entries&amp;#41;&lt;br /&gt;                       &amp;#123;&lt;br /&gt;                               OnRegisteringComponent&amp;#40;entry.Type, GetContractName&amp;#40;entry.Type, entry.Name&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                       &amp;#125;&lt;br /&gt;&lt;br /&gt;                       tracker.Registering &amp;#43;&amp;#61; &amp;#40;s, e&amp;#41; &amp;#61;&amp;#62;&lt;br /&gt;                               OnRegisteringComponent&amp;#40;e.TypeFrom &amp;#63;&amp;#63; e.TypeTo,&lt;br /&gt;GetContractName&amp;#40;e.TypeFrom &amp;#63;&amp;#63; e.TypeTo, e.Name&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                       tracker.RegisteringInstance &amp;#43;&amp;#61; &amp;#40;s, e&amp;#41; &amp;#61;&amp;#62;&lt;br /&gt;                               OnRegisteringComponent&amp;#40;e.RegisteredType,&lt;br /&gt;GetContractName&amp;#40;e.RegisteredType, e.Name&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;               &amp;#125;&lt;br /&gt;&lt;br /&gt;               public override object Resolve&amp;#40;Type type, string name&amp;#41;&lt;br /&gt;               &amp;#123;&lt;br /&gt;                       return this.container.Resolve&amp;#40;type, ExtractName&amp;#40;name&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;               &amp;#125;&lt;br /&gt;&lt;br /&gt;And on CompositionStrategy&amp;#58;&lt;br /&gt;&lt;br /&gt;public override void PreBuildUp&amp;#40;IBuilderContext context&amp;#41;&lt;br /&gt;               &amp;#123;&lt;br /&gt;                       &amp;#47;&amp;#47; If type is registered in the Unity container, don&amp;#39;t even bother&lt;br /&gt;messing with MEF&lt;br /&gt;                       var policy &amp;#61;&lt;br /&gt;context.Policies.Get&amp;#60;IBuildKeyMappingPolicy&amp;#62;&amp;#40;context.OriginalBuildKey&amp;#41;&amp;#59;&lt;br /&gt;                       if &amp;#40;policy &amp;#33;&amp;#61; null&amp;#41;&lt;br /&gt;                               return&amp;#59;&lt;br /&gt;&lt;br /&gt;                       var container &amp;#61;&lt;br /&gt;context.Policies.Get&amp;#60;ICompositionContainerPolicy&amp;#62;&amp;#40;null&amp;#41;.Container&amp;#59;&lt;br /&gt;                       var buildKey &amp;#61; context.OriginalBuildKey&amp;#59;&lt;br /&gt;                       var lazyExport &amp;#61; ContainerServices.Resolve&amp;#40;container,&lt;br /&gt;buildKey.Type, buildKey.Name&amp;#41;&amp;#59;&lt;br /&gt;                       if &amp;#40;lazyExport &amp;#33;&amp;#61; null&amp;#41;&lt;br /&gt;                       &amp;#123;&lt;br /&gt;                               context.Existing &amp;#61; lazyExport.Value&amp;#59;&lt;br /&gt;                               context.BuildComplete &amp;#61; true&amp;#59;&lt;br /&gt;                       &amp;#125;&lt;br /&gt;               &amp;#125;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The methods GetContractName and ExtractName may be anything you want,&lt;br /&gt;as long as it creates an unique contract name and extract the&lt;br /&gt;registration name from the contract name.&lt;br /&gt;In my case, the contract name is &amp;#34;type&amp;#91;registrationName&amp;#93;&amp;#34;.&lt;br /&gt;&lt;br /&gt;This solved the problem. Hope it helps someone else and makes it to next release.&lt;br /&gt;&lt;br /&gt;Regards&lt;br /&gt;</description><author>mrinaldi</author><pubDate>Mon, 07 Nov 2011 21:50:28 GMT</pubDate><guid isPermaLink="false">Created Issue: Unity integration and registration names [9768] 20111107095028P</guid></item><item><title>Commented Issue: MefContrib.MVC3 [9101]</title><link>http://mefcontrib.codeplex.com/workitem/9101</link><description>Hi All, &lt;br /&gt;I&amp;#39;m using MefContrib.MVC3 and have a rather bizar issue.&lt;br /&gt;&lt;br /&gt;When i use DependencyResolver.Current.GetServices&amp;#60;T&amp;#62;&amp;#40;&amp;#41; it returns my items twice.&lt;br /&gt;&lt;br /&gt;I made an interface IStartupTask and decorated it with the InheritedExport&amp;#40;typeof&amp;#40;IStartupTask&amp;#41;&amp;#41;&lt;br /&gt;I have some base class implementing it and finally derive this into my concrete tasks, beside the interface i have no other attributes on these.&lt;br /&gt;When I call DependencyResolver.Current.GetServices&amp;#60;T&amp;#62;&amp;#40;&amp;#41;.ToArray&amp;#40;&amp;#41; it gives me 4 items, but I should have only 2.&lt;br /&gt;Any clues on how I can debug&amp;#47;solve this &amp;#63;&lt;br /&gt;I tried to add PartCreationPolicy as shared, I would expect  this to solve the issue &amp;#40;in a bad way i agree&amp;#41; but still 4 items are returning.&lt;br /&gt;Edit &amp;#58; &lt;br /&gt;I&amp;#39;ve reflectored the code and did a couple of other tests. This seams to occure with anything that gets imported with ImportMany attribute also.&lt;br /&gt;&lt;br /&gt;Regards&lt;br /&gt;Comments: ** Comment from web user: Alive43 ** &lt;p&gt;Hi,&lt;br /&gt;I&amp;#39;ve the same issue described above. All resolutions using the &amp;#91;ImportMany&amp;#93; attribute produces twice instances. Tried using PartCreationPolicy as long as PartCreationScope and with no luck.&lt;br /&gt;Any thoughts of the authors would be appreciated.&lt;br /&gt;Thanks&amp;#33;&lt;/p&gt;</description><author>Alive43</author><pubDate>Thu, 08 Sep 2011 20:59:58 GMT</pubDate><guid isPermaLink="false">Commented Issue: MefContrib.MVC3 [9101] 20110908085958P</guid></item><item><title>Commented Issue: MefContrib.MVC3 [9101]</title><link>http://mefcontrib.codeplex.com/workitem/9101</link><description>Hi All, &lt;br /&gt;I&amp;#39;m using MefContrib.MVC3 and have a rather bizar issue.&lt;br /&gt;&lt;br /&gt;When i use DependencyResolver.Current.GetServices&amp;#60;T&amp;#62;&amp;#40;&amp;#41; it returns my items twice.&lt;br /&gt;&lt;br /&gt;I made an interface IStartupTask and decorated it with the InheritedExport&amp;#40;typeof&amp;#40;IStartupTask&amp;#41;&amp;#41;&lt;br /&gt;I have some base class implementing it and finally derive this into my concrete tasks, beside the interface i have no other attributes on these.&lt;br /&gt;When I call DependencyResolver.Current.GetServices&amp;#60;T&amp;#62;&amp;#40;&amp;#41;.ToArray&amp;#40;&amp;#41; it gives me 4 items, but I should have only 2.&lt;br /&gt;Any clues on how I can debug&amp;#47;solve this &amp;#63;&lt;br /&gt;I tried to add PartCreationPolicy as shared, I would expect  this to solve the issue &amp;#40;in a bad way i agree&amp;#41; but still 4 items are returning.&lt;br /&gt;Edit &amp;#58; &lt;br /&gt;I&amp;#39;ve reflectored the code and did a couple of other tests. This seams to occure with anything that gets imported with ImportMany attribute also.&lt;br /&gt;&lt;br /&gt;Regards&lt;br /&gt;Comments: ** Comment from web user: sebdg ** &lt;p&gt;I apparently fixed my issue, but i might have broken the logic in there.&lt;br /&gt;To resume i had to create a custom dependency resolver and overwritten the way the Container property works&lt;br /&gt;The small change i did is not passing in any export provider. to the container that is hold on a request base.&lt;br /&gt;Now my tasks and controllers are resolved only once.&lt;/p&gt;&lt;p&gt;public CompositionContainer Container&lt;br /&gt;        &amp;#123;&lt;br /&gt;            get&lt;br /&gt;            &amp;#123;&lt;br /&gt;                if &amp;#40;&amp;#33;CurrentRequestContext.Items.Contains&amp;#40;&amp;#34;__CompositionDependencyResolver_Container&amp;#34;&amp;#41;&amp;#41;&lt;br /&gt;                &amp;#123;&lt;br /&gt;                    CurrentRequestContext.Items.Add&amp;#40;&amp;#34;__CompositionDependencyResolver_Container&amp;#34;, new CompositionContainer&amp;#40;this.filteredCatalog, true, new ExportProvider&amp;#91;&amp;#93; &amp;#123;&amp;#125;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                &amp;#125;&lt;br /&gt;                return &amp;#40;CompositionContainer&amp;#41; CurrentRequestContext.Items&amp;#91;&amp;#34;__CompositionDependencyResolver_Container&amp;#34;&amp;#93;&amp;#59;&lt;br /&gt;            &amp;#125;&lt;br /&gt;        &amp;#125;&lt;/p&gt;</description><author>sebdg</author><pubDate>Sun, 17 Jul 2011 16:40:51 GMT</pubDate><guid isPermaLink="false">Commented Issue: MefContrib.MVC3 [9101] 20110717044051P</guid></item><item><title>Created Issue: MefContrib.MVC3 [9101]</title><link>http://mefcontrib.codeplex.com/workitem/9101</link><description>Hi All, &lt;br /&gt;I&amp;#39;m using MefContrib.MVC3 and have a rather bizar issue.&lt;br /&gt;&lt;br /&gt;When i use DependencyResolver.Current.GetServices&amp;#60;T&amp;#62;&amp;#40;&amp;#41; it returns my items twice.&lt;br /&gt;&lt;br /&gt;I made an interface IStartupTask and decorated it with the InheritedExport&amp;#40;typeof&amp;#40;IStartupTask&amp;#41;&amp;#41;&lt;br /&gt;I have some base class implementing it and finally derive this into my concrete tasks, beside the interface i have no other attributes on these.&lt;br /&gt;When I call DependencyResolver.Current.GetServices&amp;#60;T&amp;#62;&amp;#40;&amp;#41;.ToArray&amp;#40;&amp;#41; it gives me 4 items, but I should have only 2.&lt;br /&gt;Any clues on how I can debug&amp;#47;solve this &amp;#63;&lt;br /&gt;I tried to add PartCreationPolicy as shared, I would expect  this to solve the issue &amp;#40;in a bad way i agree&amp;#41; but still 4 items are returning.&lt;br /&gt;I have no clue on how i can digg in deeper in this issue.&lt;br /&gt;&lt;br /&gt;Regards&lt;br /&gt;</description><author>sebdg</author><pubDate>Sun, 17 Jul 2011 13:49:13 GMT</pubDate><guid isPermaLink="false">Created Issue: MefContrib.MVC3 [9101] 20110717014913P</guid></item><item><title>Commented Issue: [ImportingContsructor] doesn't work with an open generic. [5856]</title><link>http://mefcontrib.codeplex.com/workitem/5856</link><description>To fix add the following to TypeHelper&lt;br /&gt;&lt;br /&gt;public static bool IsReflectionParameterImportDefinition&amp;#40;ImportDefinition definition&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            return definition.GetType&amp;#40;&amp;#41;.Name.Equals&amp;#40;&amp;#34;ReflectionParameterImportDefinition&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;&lt;br /&gt;and change&amp;#58; if &amp;#40;&amp;#33;exports.Any&amp;#40;&amp;#41; &amp;#38;&amp;#38; TypeHelper.IsReflectionMemberImportDefinition&amp;#40;definition&amp;#41;&amp;#41; &lt;br /&gt;&lt;br /&gt;to&amp;#58; if &amp;#40;&amp;#33;exports.Any&amp;#40;&amp;#41; &amp;#38;&amp;#38; &amp;#40;TypeHelper.IsReflectionMemberImportDefinition&amp;#40;definition&amp;#41; &amp;#124;&amp;#124; TypeHelper.IsReflectionParameterImportDefinition&amp;#40;definition&amp;#41;&amp;#41;&amp;#41;&lt;br /&gt;Comments: ** Comment from web user: dancemonkey ** &lt;p&gt;been looking on how to solve this, thank you.&lt;/p&gt;</description><author>dancemonkey</author><pubDate>Fri, 17 Sep 2010 03:08:49 GMT</pubDate><guid isPermaLink="false">Commented Issue: [ImportingContsructor] doesn't work with an open generic. [5856] 20100917030849A</guid></item><item><title>Created Issue: Missing Unity (Silverlight) library in latest source (47517) [6019]</title><link>http://mefcontrib.codeplex.com/WorkItem/View.aspx?WorkItemId=6019</link><description>The latest source &amp;#40;changeset 47517&amp;#41; has a missing Unity &amp;#40;Silverlight&amp;#41; library, The desktop version is present.&lt;br /&gt;</description><author>metaman</author><pubDate>Wed, 28 Apr 2010 08:11:53 GMT</pubDate><guid isPermaLink="false">Created Issue: Missing Unity (Silverlight) library in latest source (47517) [6019] 20100428081153A</guid></item><item><title>Created Issue: [ImportingContsructor] doesn't work with an open generic. [5856]</title><link>http://mefcontrib.codeplex.com/WorkItem/View.aspx?WorkItemId=5856</link><description>To fix add the following to TypeHelper&lt;br /&gt;&lt;br /&gt;public static bool IsReflectionParameterImportDefinition&amp;#40;ImportDefinition definition&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            return definition.GetType&amp;#40;&amp;#41;.Name.Equals&amp;#40;&amp;#34;ReflectionParameterImportDefinition&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;&lt;br /&gt;and change&amp;#58; if &amp;#40;&amp;#33;exports.Any&amp;#40;&amp;#41; &amp;#38;&amp;#38; TypeHelper.IsReflectionMemberImportDefinition&amp;#40;definition&amp;#41;&amp;#41; &lt;br /&gt;&lt;br /&gt;to&amp;#58; if &amp;#40;&amp;#33;exports.Any&amp;#40;&amp;#41; &amp;#38;&amp;#38; &amp;#40;TypeHelper.IsReflectionMemberImportDefinition&amp;#40;definition&amp;#41; &amp;#124;&amp;#124; TypeHelper.IsReflectionParameterImportDefinition&amp;#40;definition&amp;#41;&amp;#41;&amp;#41;&lt;br /&gt;</description><author>jabbera</author><pubDate>Mon, 05 Apr 2010 17:59:06 GMT</pubDate><guid isPermaLink="false">Created Issue: [ImportingContsructor] doesn't work with an open generic. [5856] 20100405055906P</guid></item><item><title>Created Issue: GenericCatalog CreateDynamicExport returing null is some cases [5833]</title><link>http://mefcontrib.codeplex.com/WorkItem/View.aspx?WorkItemId=5833</link><description>If the importDefinition passed to CreateDynamicExport is a non generic interface the return value could be null. This should never happen or the program will crash.&lt;br /&gt;&lt;br /&gt;Using reflector on CatalogExportProvider&amp;#58;&amp;#58;GetExportsCore you will see why.&lt;br /&gt;&lt;br /&gt;   foreach &amp;#40;Tuple&amp;#60;ComposablePartDefinition, ExportDefinition&amp;#62; tuple in valueAllowNull.GetExports&amp;#40;definition&amp;#41;&amp;#41;   &lt;br /&gt;&lt;br /&gt;I see two solutions&amp;#58; set the export before the return value if it is null or change&amp;#58;&lt;br /&gt;&lt;br /&gt;if &amp;#40;importDefinitionType.IsClass&amp;#41;&lt;br /&gt;to&lt;br /&gt;if &amp;#40;importDefinitionType.IsClass &amp;#124;&amp;#124; importDefinitionType.IsInterface&amp;#41;&lt;br /&gt;&lt;br /&gt;I don&amp;#39;t know if that change is correct but for now it seems to work around my issue.&lt;br /&gt;&lt;br /&gt;Mike&lt;br /&gt;</description><author>jabbera</author><pubDate>Wed, 31 Mar 2010 18:59:56 GMT</pubDate><guid isPermaLink="false">Created Issue: GenericCatalog CreateDynamicExport returing null is some cases [5833] 20100331065956P</guid></item><item><title>Closed Issue: Unity Integration: Order of registrations and ChildContainers [4981]</title><link>http://mefcontrib.codeplex.com/WorkItem/View.aspx?WorkItemId=4981</link><description>Hey,&lt;br /&gt;&lt;br /&gt;We are currently using UnityIntgration in a Silverlight 4 &amp;#47; .net 4 beta2 project and we have encountered several bugs &amp;#58;&lt;br /&gt;The first one, wich is least critical is that if you register types in your container before calling RegisterCatalog, MEF cannot resolve these registered types.&lt;br /&gt;The second, which if very critical &amp;#40;as complex UI architecture depends highly on it&amp;#41;, is that MEF components do not respect ChildContainer Registered Instances. &lt;br /&gt;&lt;br /&gt;Here is an exemple of code that fails &amp;#58;&lt;br /&gt;&lt;br /&gt;            IUnityContainer container &amp;#61; ConfigureMefThenUnity&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            var unityComponent &amp;#61; container.Resolve&amp;#60;IUnityComponent&amp;#62;&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            container &amp;#61; container.CreateChildContainer&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            container.RegisterInstance&amp;#60;IUnityComponent&amp;#62;&amp;#40;unityComponent&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            var component &amp;#61; container.Resolve&amp;#60;IMefDependingOnUnity2&amp;#62;&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            Assert.IsNotNull&amp;#40;component&amp;#41;&amp;#59;&lt;br /&gt;            Assert.IsNotNull&amp;#40;component.UnityComponent&amp;#41;&amp;#59;&lt;br /&gt;            Assert.AreEqual&amp;#40;unityComponent, component.UnityComponent&amp;#41;&amp;#59; &amp;#47;&amp;#47; fails here, MEF is using the rule defined on the parent container instead of the overriden one in the child container&lt;br /&gt;&lt;br /&gt;Attached is the full test file highlighting the 2 bugs described above&lt;br /&gt;Comments: &lt;p&gt;&lt;/p&gt;</description><author>pwlodek</author><pubDate>Mon, 28 Dec 2009 12:20:57 GMT</pubDate><guid isPermaLink="false">Closed Issue: Unity Integration: Order of registrations and ChildContainers [4981] 20091228122057P</guid></item><item><title>Commented Issue: Unity Integration: Order of registrations and ChildContainers [4981]</title><link>http://mefcontrib.codeplex.com/WorkItem/View.aspx?WorkItemId=4981</link><description>Hey,&lt;br /&gt;&lt;br /&gt;We are currently using UnityIntgration in a Silverlight 4 &amp;#47; .net 4 beta2 project and we have encountered several bugs &amp;#58;&lt;br /&gt;The first one, wich is least critical is that if you register types in your container before calling RegisterCatalog, MEF cannot resolve these registered types.&lt;br /&gt;The second, which if very critical &amp;#40;as complex UI architecture depends highly on it&amp;#41;, is that MEF components do not respect ChildContainer Registered Instances. &lt;br /&gt;&lt;br /&gt;Here is an exemple of code that fails &amp;#58;&lt;br /&gt;&lt;br /&gt;            IUnityContainer container &amp;#61; ConfigureMefThenUnity&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            var unityComponent &amp;#61; container.Resolve&amp;#60;IUnityComponent&amp;#62;&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            container &amp;#61; container.CreateChildContainer&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            container.RegisterInstance&amp;#60;IUnityComponent&amp;#62;&amp;#40;unityComponent&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            var component &amp;#61; container.Resolve&amp;#60;IMefDependingOnUnity2&amp;#62;&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            Assert.IsNotNull&amp;#40;component&amp;#41;&amp;#59;&lt;br /&gt;            Assert.IsNotNull&amp;#40;component.UnityComponent&amp;#41;&amp;#59;&lt;br /&gt;            Assert.AreEqual&amp;#40;unityComponent, component.UnityComponent&amp;#41;&amp;#59; &amp;#47;&amp;#47; fails here, MEF is using the rule defined on the parent container instead of the overriden one in the child container&lt;br /&gt;&lt;br /&gt;Attached is the full test file highlighting the 2 bugs described above&lt;br /&gt;Comments: ** Comment from web user: pwlodek ** &lt;p&gt;Bug 1&lt;br /&gt;Unity does not provide tracking mechanism that is available to the developer. In order to make types registered in the Unity available to MEF before calling RegisterCatalog, developer needs to explicitly add tracking extension to the Unity. This is done in single line of code, ofcourse MEF does not participate here.&lt;/p&gt;&lt;p&gt;var container &amp;#61; new UnityContainer&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;TypeRegistrationTrackerExtension.RegisterIfMissing&amp;#40;container&amp;#41;&amp;#59;&lt;/p&gt;&lt;p&gt;Bug 2&lt;br /&gt;In order to make a child container properly work with MEF, developer needs to manually enable MEF integration.&lt;/p&gt;&lt;p&gt;IUnityContainer container &amp;#61; new UnityContainer&amp;#40;&amp;#41;&amp;#59;&lt;/p&gt;&lt;p&gt;container &amp;#61; container.CreateChildContainer&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;container.EnableCompositionIntegration&amp;#40;&amp;#41;&amp;#59;&lt;/p&gt;</description><author>pwlodek</author><pubDate>Mon, 28 Dec 2009 12:19:34 GMT</pubDate><guid isPermaLink="false">Commented Issue: Unity Integration: Order of registrations and ChildContainers [4981] 20091228121934P</guid></item><item><title>Commented Issue: Unity Integration: Order of registrations and ChildContainers [4981]</title><link>http://mefcontrib.codeplex.com/WorkItem/View.aspx?WorkItemId=4981</link><description>Hey,&lt;br /&gt;&lt;br /&gt;We are currently using UnityIntgration in a Silverlight 4 &amp;#47; .net 4 beta2 project and we have encountered several bugs &amp;#58;&lt;br /&gt;The first one, wich is least critical is that if you register types in your container before calling RegisterCatalog, MEF cannot resolve these registered types.&lt;br /&gt;The second, which if very critical &amp;#40;as complex UI architecture depends highly on it&amp;#41;, is that MEF components do not respect ChildContainer Registered Instances. &lt;br /&gt;&lt;br /&gt;Here is an exemple of code that fails &amp;#58;&lt;br /&gt;&lt;br /&gt;            IUnityContainer container &amp;#61; ConfigureMefThenUnity&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            var unityComponent &amp;#61; container.Resolve&amp;#60;IUnityComponent&amp;#62;&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            container &amp;#61; container.CreateChildContainer&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            container.RegisterInstance&amp;#60;IUnityComponent&amp;#62;&amp;#40;unityComponent&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            var component &amp;#61; container.Resolve&amp;#60;IMefDependingOnUnity2&amp;#62;&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            Assert.IsNotNull&amp;#40;component&amp;#41;&amp;#59;&lt;br /&gt;            Assert.IsNotNull&amp;#40;component.UnityComponent&amp;#41;&amp;#59;&lt;br /&gt;            Assert.AreEqual&amp;#40;unityComponent, component.UnityComponent&amp;#41;&amp;#59; &amp;#47;&amp;#47; fails here, MEF is using the rule defined on the parent container instead of the overriden one in the child container&lt;br /&gt;&lt;br /&gt;Attached is the full test file highlighting the 2 bugs described above&lt;br /&gt;Comments: ** Comment from web user: pwlodek ** &lt;p&gt;Bug 1&lt;br /&gt;Unity does not provide tracking mechanism that is available to the developer. In order to make types registered in the Unity available to MEF before calling RegisterCatalog, developer needs to explicitly add tracking extension to the Unity. This is done in single line of code, ofcourse MEF does not participate here.&lt;/p&gt;&lt;p&gt;var container &amp;#61; new UnityContainer&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;TypeRegistrationTrackerExtension.RegisterIfMissing&amp;#40;container&amp;#41;&amp;#59;&lt;/p&gt;&lt;p&gt;Bug 2&lt;br /&gt;In order to make a child container properly work with MEF, developer needs to manually enable MEF integration.&lt;/p&gt;&lt;p&gt;IUnityContainer container &amp;#61; new UnityContainer&amp;#40;&amp;#41;&amp;#59;&lt;/p&gt;&lt;p&gt;container &amp;#61; container.CreateChildContainer&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;container.EnableCompositionIntegration&amp;#40;&amp;#41;&amp;#59;&lt;/p&gt;</description><author>pwlodek</author><pubDate>Mon, 28 Dec 2009 12:19:30 GMT</pubDate><guid isPermaLink="false">Commented Issue: Unity Integration: Order of registrations and ChildContainers [4981] 20091228121930P</guid></item><item><title>Created Issue: Unity Integration: Order of registrations and ChildContainers [4981]</title><link>http://mefcontrib.codeplex.com/WorkItem/View.aspx?WorkItemId=4981</link><description>Hey,&lt;br /&gt;&lt;br /&gt;We are currently using UnityIntgration in a Silverlight 4 &amp;#47; .net 4 beta2 project and we have encountered several bugs &amp;#58;&lt;br /&gt;The first one, wich is least critical is that if you register types in your container before calling RegisterCatalog, MEF cannot resolve these registered types.&lt;br /&gt;The second, which if very critical &amp;#40;as complex UI architecture depends highly on it&amp;#41;, is that MEF components do not respect ChildContainer Registered Instances. &lt;br /&gt;&lt;br /&gt;Here is an exemple of code that fails &amp;#58;&lt;br /&gt;&lt;br /&gt;            IUnityContainer container &amp;#61; ConfigureMefThenUnity&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            var unityComponent &amp;#61; container.Resolve&amp;#60;IUnityComponent&amp;#62;&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            container &amp;#61; container.CreateChildContainer&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            container.RegisterInstance&amp;#60;IUnityComponent&amp;#62;&amp;#40;unityComponent&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            var component &amp;#61; container.Resolve&amp;#60;IMefDependingOnUnity2&amp;#62;&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            Assert.IsNotNull&amp;#40;component&amp;#41;&amp;#59;&lt;br /&gt;            Assert.IsNotNull&amp;#40;component.UnityComponent&amp;#41;&amp;#59;&lt;br /&gt;            Assert.AreEqual&amp;#40;unityComponent, component.UnityComponent&amp;#41;&amp;#59; &amp;#47;&amp;#47; fails here, MEF is using the rule defined on the parent container instead of the overriden one in the child container&lt;br /&gt;&lt;br /&gt;Attached is the full test file highlighting the 2 bugs described above&lt;br /&gt;</description><author>simonferquel</author><pubDate>Wed, 23 Dec 2009 15:14:12 GMT</pubDate><guid isPermaLink="false">Created Issue: Unity Integration: Order of registrations and ChildContainers [4981] 20091223031412P</guid></item><item><title>Commented Issue: Provider Model - DefinitionProviderPartCatalog does not cache values unless aggregated</title><link>http://mefcontrib.codeplex.com/WorkItem/View.aspx?WorkItemId=1943</link><description>The DefinitionProviderPartCatalog does not cache any parts unless it&amp;#39;s added to an AggregateCatalog first. This means that when the AddProviderPart metnod is called on the CompositionContainer it will fail with an exception. The reason for this is that the method will try to retreive a ProviderComposablePartDefinition for the object instance and the cache will be empty&amp;#33;&lt;br /&gt;Comments: ** Comment from web user: TheCodeJunkie ** &lt;p&gt;This issue has been resolved in change set 15094&lt;/p&gt;</description><author>TheCodeJunkie</author><pubDate>Sat, 07 Mar 2009 20:26:52 GMT</pubDate><guid isPermaLink="false">Commented Issue: Provider Model - DefinitionProviderPartCatalog does not cache values unless aggregated 20090307082652P</guid></item><item><title>Commented Issue: Provider Model - DefinitionProviderPartCatalog does not cache values unless aggregated</title><link>http://mefcontrib.codeplex.com/WorkItem/View.aspx?WorkItemId=1943</link><description>The DefinitionProviderPartCatalog does not cache any parts unless it&amp;#39;s added to an AggregateCatalog first. This means that when the AddProviderPart metnod is called on the CompositionContainer it will fail with an exception. The reason for this is that the method will try to retreive a ProviderComposablePartDefinition for the object instance and the cache will be empty&amp;#33;&lt;br /&gt;Comments: ** Comment from web user: TheCodeJunkie ** &lt;p&gt;A quick work around for this, until a fix has been checked in, is to add the DefinitionProviderPartCatalog to an AggregateCatalog which is then passed to the CompositionContainer&lt;/p&gt;</description><author>TheCodeJunkie</author><pubDate>Thu, 05 Mar 2009 21:36:41 GMT</pubDate><guid isPermaLink="false">Commented Issue: Provider Model - DefinitionProviderPartCatalog does not cache values unless aggregated 20090305093641P</guid></item></channel></rss>