How can I consume a Service from global.asax?

Sep 5, 2007 at 7:14 PM
I'd like to access a service registered from a foundation module within one of the application events in Global. Anybody have any thoughts on how to do this?

Thanks,
Chris
Sep 5, 2007 at 7:21 PM
Well, I really should have waited a few more minutes before I posted.

Since Global inherits from WebClientApplication, and WebClientApplication is what owns the root composition container, you can just access the services collection of that root container directly:

IMyService myService = RootContainer.Services.Get<IMyService>();

Hope this helps somebody else find a quick answer, at least :).