Q:

Resolve service Using DI in Startup.cs

I have used autofac ,mvc 4.0 .
I have registered the interfaces and modules in Application_Start of my mvc 4.0 application.
I have also used properties auto wired eg
protected void Application_Start()
        {
//Other codes...
builder.RegisterType<Service>()
                .As<IService>()
                .InstancePerLifetimeScope()
                .PropertiesAutowired());
      builder.RegisterControllers(typeof (MvcApplication).Assembly)
                    .PropertiesAutowired();
...
}

However The dependencies are not resolved in the startup class, and the object is always null .
 public class Startup
    {
    public IService MyService { get; set; }
        public void Configuration(IAppBuilder app)
        {
            MyService.SomeMetod(3, "");
        }
     }

In above code I was expecting MyService to be an object , but its not so it is always null, Am I doing something wrong Please Help.
Please note that the di is working in controllers , it is not working in the startup class only !

A:

I was expecting AutoFac to resolve dependency automatically as it does in the controller classes , It was solved using manual resolution as following:
 var myService = (IService)DependencyResolver.Current.GetService(typeof(IService ));

