Access or get Autofac Container inside a static class
I need to get or access to my IoC container in a static class. This is my (simplified) scenario: I register dependencies for ASP .net Web Api in a Startup class (but also I do this for MVC or WCF. I have a DependecyResolver project, but for simplicity, consider the following code) // Web Api project - Startup.cs public void Configuration(IAppBuilder app) { HttpConfiguration config = new HttpConfiguration(); var builder = new ContainerBuilder(); // ... Omited for clarity builder.RegisterAssemblyTypes(AppDomain.CurrentDomain.GetAssemblies()) .AsClosedTypesOf(typeof(IHandle<>))