All my registrations are happening in the Application_Start() event on
the global.
protected void Application_Start(object sender, EventArgs e)
{
var builder = new ContainerBuilder();
builder.RegisterType<MembershipService>().InstancePerDependency();
builder.RegisterType<Logic.MembershipLogic>().As<IMembershipLogic>().InstancePerLifetimeScope();
AutofacHostFactory.Container = builder.Build();
}
All is happy when using a binding that uses HTTP Activation. Then I
tried to switch over to net.tcp, and none of the events in the
Global.asax fire.
What is the best/least painful/standard/etc way to initialize Autofac
when using WAS/non-HTTP activation WCF services? I've seen posts
suggesting AppInitialize(), but those are pretty ugly.
Thanks,
Josh
> --
> You received this message because you are subscribed to the Google Groups "Autofac" group.
> To post to this group, send email to aut...@googlegroups.com.
> To unsubscribe from this group, send email to autofac+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/autofac?hl=en.
>
>
http://www.asp.net/LEARN/whitepapers/aspnet4/default.aspx#_TOC1_3
If you don't want to write any code there is a module that you can
install that will do this for you:
http://www.iis.net/download/applicationwarmup
Just feed it some URL's to hit when the app pool comes up and you're
good to go. In the case of a non-HTTP activation WCF / WAS scenario
you might consider having a "ping" page in the application you deploy
under IIS that you configure the module to hit...just thinking out
loud...
Please let me know how it works out for you if you decide to make use
of this approach (code for the event or the module) - would love to
know myself! :)