"StructureMapConfigurationException was caught" Could not find an Instance named 'cert5' for plugintype

495 views Asked by At

my controller class

 IPaymentProcessor _paymentProcessor = ObjectFactory.Container.GetInstance<IPaymentProcessor>("cert5"); 

my IoC class

   x.For<IX509Cert>().Use<X509Cert>().Ctor<string>().Is(Settings.GetCreditCardCertFile(5)).Named("cert5");    
1

There are 1 answers

1
Leonardo Wildt On BEST ANSWER

When using multiple credit card cert files it may be a better option to not use the IoC container. You can use an instance of the IPaymentprocesssor inside your controller directly instead.