I am currently upgrading the Prism library of an application, going from version 7.0 to 8.1. We use MEF to extend the application, and the older version of Prism had built-in support for MEF. Going to 8.1 we need do some implementation to adapt Prism to MEF, and that is fine. However, the default region adapters that Prism provides are not being registered with the Prism container extension, unless I do that by myself. Later during the bootstrapping Prism tries to resolve them, but that fails, since they are not registered. How come they are not registered at any time, or have I missed something else?
Asked
Active
Viewed 31 times
0
-
MEF's not a container, it's a plugin-framework – Haukinger Sep 23 '21 at 13:35
-
Updated my question to hopefully clarify that my question is regarding Prism, not MEF. – Sara Sep 24 '21 at 06:46
-
Which container extension do you use? – Haukinger Sep 24 '21 at 10:08
-
We use System.ComponentModel.Composition.Hosting.CompositionContainer – Sara Sep 24 '21 at 12:51
-
That doesn't sound like a container _extension_... – Haukinger Sep 24 '21 at 14:23
-
I'm not sure I understand what information you are asking for to be able to answer my question about the region adapters registration. I'm wondering about why none of the IContainerRegistry.Register* methods is called for the default region adapters, while IContainerProvider.Resolve is called for the default region adapters. Am I supposed to add the registration of the default region adapters? – Sara Sep 24 '21 at 14:40
-
For `Unity` and `DryIoc`, [`PrismApplicationBase`](https://github.com/PrismLibrary/Prism/blob/2b9873d9a6595c1f50ca9e6f6605d0bb82b0ea5f/src/Wpf/Prism.Wpf/PrismApplicationBase.cs#L69) does the registration. If you implement your own `Application` class, you can't expect them to magically register themselves, can you? Therefore, it may be enlightening to see the code of your `Application` class (or your `Bootstrapper`, if you prefer the classic approach). – Haukinger Sep 24 '21 at 17:31
-
Since a list of other classes, such as RegionManager, RegionAdapterMappings and more, are magically registered without my touch, I thought it would be natural that also the default adapters where registered. Maybe it's due to their constructors are importing a factory that their registration needs to be made according to the selected approach? I'll carry on from there, thanks for taking your time to elaborate on this! – Sara Sep 25 '21 at 06:59