Hi, I'm doing some prototyping with the new v2Preview4 bits, and I have a question about adding assemblies to the MvcApplicationCatalog.
I see in the source that CompositionProvider.PostStartDefaultInitialize contains the code that creates the MvcApplicationCatalog, unioning its _partAssemblies assembly collection with the global application assembly (or its guess at the global assembly).
There are also public static methods for adding parts assemblies to the _partAssemblies collection.
That seems fine, but the problem is that by the time my code executes, the MvcApplicationCatalog is already created. The start process goes like this:
1) AssemblyInfo.cs contains the PreApplicationStartMethod attribute, pointing to the RequestCompositionScopeModule.Register method
2) RequestCompositionScopeModule.Register uses DynamicModuleUtility to register itself as an http module
3) RequestCompositionScopeModule.Init (IHttpModule.Init) calls CompositionProvider.PostStartDefaultInitialize
4) CompositionProvider.PostStartDefaultInitialize creates the MvcApplicationCatalog, and then registers all of the MVC3 IoC extension points, etc.
This all happens before Application_Start in my app, so how can we register additional assemblies before PostStartDefaultInitialize is called?