Alex Rivera | Logout

Is Autofac ContainerBuilder.Build an expensive operation?

Asked 2010-12-20T15:39:29.863
11

I'm starting to use Autofac and I can't seem to find an answer to this question.

Also, when should I call ContainerBuilder.Build() ?

After I call the ContainerBuilder.Build() is it possible to register another type or instance?

Edit
Report

1 Answer

1

In my web apps I use a base HttpApplication class that calls the Build on the Application_Start event. I then use a mix of Modules (placed on each assembly that require registration), a assembly "scanner" and MVC integration.

For later registration you could use, for instance, the MEF integration, or, as Jonathan stated, use the Build overload.

Hope it helps :)

answered 2010-12-20T16:19:19.937

Your Answer