Is there a way in MEF 4.0 to get create a part directly from a catalog? I know that there was a container in the previous version, but that seems to have been abstracted away.
Edits:
To clarify, I have an external package download module. A package is my terminology for a XAP external to my main application which I use a DeploymentCatalog to download. When the asynchronous call returns the module then returns an IPackage instance which contains metadata and initialization entry points for the package. I want to do this for convenience. If I use an include-many, it is a little two decoupled in this one spot.
Other parts of the application (i.e. the navigation module) do use includes.
MEF shipped for the first time in dotnet 4.0, so
there is no “previous version” (unless you count the previews on codeplex).
Dotnet 4.0 definitely has a CompositionContainer class. Perhaps you are confused because you have this in your code:
but CompositionContainer is actually in
System.ComponentModel.Composition.Hosting? Or maybe you forgot to add a reference to System.ComponentModel.Composition.dll?