private static void UnregisterTypes(SPWeb web)
        {
            LogUtility logUtility = new LogUtility();
            try
            {
                logUtility.TraceDebugInformation("Deactivating Local utilities", typeof(ServiceLocationRegistration));
                IServiceLocator serviceLocator = new SPWebServiceLocator(web);
                IServiceLocatorConfig typeMappings = serviceLocator.GetInstance<IServiceLocatorConfig>();
                unregisterTypeMappings(typeMappings);
                logUtility.TraceDebugInformation("Successfully deactivated Local utilities", typeof(ServiceLocationRegistration));
            }
            catch (Exception exception)
            {
                logUtility.TraceDebugException("Error while deactivating Local utilities", typeof(ServiceLocationRegistration), exception);
            }

            finally
            {
                logUtility.TraceDebugInformation("Finished deactivating Local utilities", typeof(ServiceLocationRegistration));
            }
        }
 private static void RegisterTypes(SPWeb web)
 {
     web.RequireNotNull("web");
     LogUtility logger = new LogUtility();
     try
     {
         logger.TraceDebugInformation("Registering types for use across farms", typeof(ServiceLocationRegistration));
         IServiceLocator serviceLocator = new SPWebServiceLocator(web);
         IServiceLocatorConfig typeMappings = serviceLocator.GetInstance<IServiceLocatorConfig>();
         registerTypeMappings(typeMappings);
     }
     catch (Exception exception)
     {
         logger.TraceDebugException("Exception while registering types!", typeof(ServiceLocationRegistration), exception);
     }
     finally
     {
         logger.TraceDebugInformation("Finished registering types for use across farms", typeof(ServiceLocationRegistration));
     }
 }