ioc container - Setting up structure map in a c# console application -


i'm getting error:

structuremap exception code:  202 no default instance defined pluginfamily  

my setup looks like:

console.writeline("structure map"); setupsm sm = new setupsm(); sm.setup();  isomething = objectfactory.getinstance<isomething>(); console.writeline("something.howmanythings: " + something.howmanythings("asdf"));     public class setupsm     {         public void setup()         {             var c1 = new container(config =>             {                 config.scan(scan =>                 {                     scan.thecallingassembly();                     scan.withdefaultconventions();                 });             });              var c2 = new container(x =>                                               {                                                   x.for<isomething>().use<somethingone>();                                               });           }     } 

this first try @ using structure map, missing? seems guide on main website old using old syntax etc.

try applying configuration static objectfactory instead of seperate containers appear throw away immediately..

public class setupsm     {         public void setup()         {             objectfactory.configure(config =>             {                  config.scan(scan =>                 {                     scan.thecallingassembly();                     scan.withdefaultconventions();                 });                  config.for<isomething>().use<somethingone>();             });     } 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -