Load App as a .dll

Oct 18, 2013 at 9:59 PM

is there any Way to creat a .dll based Programm with Calibur?
Cous in a .dll you dont have a App.xaml, to load the bootstrap?
If i try to load a .dll, the Views can not be found.

Any Ideas?
Oct 20, 2013 at 6:52 AM
This should be possible, but not everything might be working.
What are you trying to achieve? Some more details would be of help.
Oct 21, 2013 at 7:26 PM
Edited Oct 21, 2013 at 7:27 PM

becouse we using WPF/C# on work and we search for a good framwork, to handle MVVM.
But our software opens the diff. modules through .dll.
I just tried to start a Caliburnprogramm as .dll (without bootstrap and App) out of a nother programm written with Caliburn (with Bootstrap and App).
But when i try to load Views, or Windows from the .dll i get a exception "Cannot find the View".

Do i have to edit the bootstrap for that?

At the Moment its like this:
class AppBootstrapper : Bootstrapper<MainViewModel>
        private CompositionContainer container;

        protected override void Configure()
            container = new CompositionContainer(new AggregateCatalog(AssemblySource.Instance.Select(x => new AssemblyCatalog(x)).OfType<ComposablePartCatalog>()));

            CompositionBatch batch = new CompositionBatch();

            batch.AddExportedValue<IWindowManager>(new WindowManager());
            batch.AddExportedValue<IEventAggregator>(new EventAggregator());


        protected override object GetInstance(Type serviceType, string key)
            string contract = string.IsNullOrEmpty(key) ? AttributedModelServices.GetContractName(serviceType) : key;
            var exports = container.GetExportedValues<object>(contract);

            if (exports.Count() > 0)
                return exports.First();

            throw new Exception(string.Format("Could not locate any instances of contract {0}.", contract));
Oct 22, 2013 at 5:10 AM
Your bootstrapper has to override SelectAssemblies() to return the assemblies that contain the Views and ViewModels.
Per default it only returns the entry assembly (the EXE).
Marked as answer by tibel on 10/22/2013 at 9:51 AM
Oct 22, 2013 at 9:53 AM
Edited Oct 22, 2013 at 9:54 AM
Hey Tibel,

thanks a lot, it works fine!


Sean Roddis