It totally does not work in my code

Dec 27, 2013 at 12:07 PM
Edited Dec 27, 2013 at 12:09 PM
    public class UnityHelper
    {
        static UnityHelper()
        {
            var assemblies = AppDomain.CurrentDomain.GetAssemblies().Where(
                a => a.FullName.StartsWith("MyApp", StringComparison.OrdinalIgnoreCase)).ToArray();

            //RootContainer = new UnityContainer();

            // add extension
            RootContainer.AddNewExtension<AutoRegistExtension>();
            // configure extension
            var config = RootContainer.Configure<AutoRegistExtension>();
            // add assembly
            config.AddProvider(new AssemblyRegistTypeTraitProvider(assemblies));
        }

        public static UnityContainer RootContainer = new UnityContainer();
}
Above are my code to initialize the container. but actually it will not register any of my classes with UnityExport attribute.