New Posts New Posts RSS Feed: AppBootstrapper Issue
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

AppBootstrapper Issue

 Post Reply Post Reply
Author
bobmre View Drop Down
Newbie
Newbie


Joined: 05-Jul-2012
Posts: 2
Post Options Post Options   Quote bobmre Quote  Post ReplyReply Direct Link To This Post Topic: AppBootstrapper Issue
    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);

}

Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post 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:
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down