Print Page | Close Window

AppBootstrapper Issue

Printed From: IdeaBlade
Category: Cocktail
Forum Name: Community Forum
Forum Discription: A professional application framework using Caliburn.Micro and DevForce
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3594
Printed Date: 05-May-2024 at 4:42am


Topic: AppBootstrapper Issue
Posted By: bobmre
Subject: AppBootstrapper Issue
Date Posted: 23-Aug-2012 at 4:10pm
How would I implement the following code in the Cocktail bootstrapper?  The code is from a Caliburn.Micro bootstrapper which loads the assembly files from a subdirectory into the container.
 

protected override IEnumerable<System.Reflection.Assembly> SelectAssemblies()

{

var assemblies = base.SelectAssemblies();

var directory = new DirectoryInfo(@"Modules");

var files = directory.GetFiles("*.dll", SearchOption.TopDirectoryOnly);

//only load the the dlls that are from this namespace

var modules = files.Where(f => f.Name.Contains("CaliburnProto"))

.Select(f => Assembly.LoadFile(f.FullName));

return assemblies.Concat(modules);

}




Replies:
Posted By: mgood
Date Posted: 23-Aug-2012 at 5:17pm
You tell the CompositionHost where to look for your assemblies.
 
        static AppBootstrapper()
        {
            CompositionHost.SearchFolders.Add("Modules");
        }
More on how you can control the discovery can be found here:
 
http://drc.ideablade.com/xwiki/bin/view/Documentation/discovery -



Print Page | Close Window