.net - NServiceBus property not injecting -


i'm running nservicebus 2.0 , trying create service receive forwarded messages , drop them in (ravendb) database. admit don't have firm grasp on how nservicebus works ioc containers (nor have used spring before), may doing wrong.

in iwanttorunonstartup class, i'm getting null reference exception call store.initialize(). hooking singleton correctly? there need in config files?

here code:

public class endpointconfig : iconfigurethisendpoint, asa_server, iwantcustominitialization {     private imessagerepository _store;      public void init()     {         _store = new ravenmessagerepository();          configure.with()             .defaultbuilder()             .xmlserializer()             .unicastbus();          configure.instance.configurer.registersingleton<imessagerepository>(_store);     }  }  public class startupconfig : iwanttorunatstartup {     public imessagerepository store;      public void run()     {         store.initialize();     }      public void stop()     {     } } 

thanks-

you need change store member property get/set. have not confirmed this, container looking setter , can't find it(copied comment others see answered)


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -