My guess is this: You have files in "Helper.PluginsDirectory" that is already loaded by the plugin framework. If you load one of them twice you will not be able to get the export.
A workaround...
class Program
{
static void Main(string[] args)
{
Composable.RegisterExport<IAnimal>();
//Helper that fix your issue...
Helpers.AddLocation(@"C:\Users\Uffe\Desktop\DynamicAssemblies\Implementation\bin\Debug", SearchOption.AllDirectories);
Composable.ReCompose();
var a = Composable.GetExports<IAnimal>();
foreach (var animal in a)
{
animal.Says();
}
Console.ReadLine();
}
}
public static class Helpers
{
public static void AddLocation(string location, System.IO.SearchOption searchOption)
{
foreach (var assembly in Directory.GetFiles(location, "*.dll", searchOption))
{
AssemblyName verifyName = AssemblyName.GetAssemblyName(assembly);
if(!Composable.LoadedAssemblies.Any(p => p.FullName == verifyName.FullName))
Composable.LoadAssembly(assembly);
}
}
}