Managing same view models and Views in assemblies of different versions.

Topics: Bootstrappers & IoC, Extensibility, Feature Requests, UI Architecture
Jun 2, 2015 at 4:39 PM
Hello
first thanks for the very useful tool.

Now we stumbled over one issue, which we could not solve.

We are loading dynamically assemblies containing specific views using the "AssemblySource" type.

Our goal is to offer different versions of views in the same application. Each view is implemented in an appropriate assembly with the same name. We accomplish the loading with the standard .NET mechanism with strong naming and different assembly versions. This works very good as far as loading the assemblies and getting the appropriate view model over the IOC.

Now the problem: Since we use the same type names for the view models in the different assemblies with different version caliburn gets an problem when it tries to associate the view model with the appropriate view, since it exists in assemblies of different versions with the same name. An internal used dictionary of caliburn returns "Key already exists" error. when we try to load a second view model.

When we use different names for the view models and views it works perfectly. But this solution is not preferred, since versionmanagement in two places is needed (assembly version and type name of the view model and view)

Is there a possibility to intercept with the caliburn mechanism, which associates the view model with the view? This would give us the possibility to use the correct assembly, where the view model can find the view.
If not: would it be a feature caliburn can offer?

Any other ideas are appreciated?

Thanks
Jörg