I am trying to write a StructureMap plugin for implementing a Payment Gateway. I created the IPaymentGateway interface in an external library. I created several implementations of IPaymentGateway and put these .dlls in the C: \ Extensions \ folder.
Here is my StructureMap configuration:
ObjectFactory.Initialize(cfg =>
{
cfg.Scan(scanner =>
{
scanner.AssembliesFromPath(@"C:\Extensions\");
});
});
Here is my code:
var list = ObjectFactory.GetAllInstances<IPaymentGateway>().ToList();
list.ForEach(item => Console.WriteLine(item.FriendlyName));
I would expect the list should contain each of my IPaymentGateway implementations, but it does not contain anything. What am I missing?
Thank!
source
share