public static void ValidateIsOnlyCalledFromGlobalInitializerFacade(StackTrace stackTrace)
{
MethodBase methodInfo = stackTrace.GetFrame(1).GetMethod();
if (methodInfo.DeclaringType != typeof(GlobalInitializerFacade))
{
throw new SystemException(string.Format("The method {0} may only be called by the {1}", stackTrace.GetFrame(1).GetMethod(), typeof(GlobalInitializerFacade)));
}
}