Guest User

Untitled

a guest
May 10th, 2012
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. Structure Map Error Code 202
  2. public static void Configure()
  3. {
  4. var log = LogManager.GetLogger(typeof (Global1));
  5.  
  6. log.Debug("Initializing Container");
  7. /*Initialize IoC Container*/
  8. ObjectFactory.Initialize(x =>
  9. {
  10. x.For<ITokenService>().Use<TokenService>();
  11. x.For<ILocalizationService>().Use<LocalizationService>();
  12.  
  13. log.Debug("Initializing Object Factory");
  14. /*Setup Property Injection*/
  15. x.SetAllProperties(p =>
  16. {
  17. p.OfType<ITokenService>();
  18. p.OfType<ILocalizationService>();
  19. });
  20. });
  21.  
  22. }
  23.  
  24. public BasePage()
  25. {
  26. var log = LogManager.GetLogger(typeof (Global1));
  27. log.Debug("Base Page Build Up");
  28. /*Inject Dependencies*/
  29. ObjectFactory.BuildUp(this);
  30. }
  31.  
  32. protected void Application_Start(object sender, EventArgs e)
  33. {
  34.  
  35. log.Debug("In Application Start - Pre BuildUp");
  36. /*Configure Ioc Container*/
  37. IocConfigurator.Configure();
  38. }
Advertisement
Add Comment
Please, Sign In to add comment