private static void EnsureHookingFacade(object timeSpanToDelayStart)
{
// NOTE: Condition is made for unit-testing
if (System.Web.Hosting.HostingEnvironment.IsHosted)
{
var kvp = (KeyValuePair<TimeSpan, StackTrace>)timeSpanToDelayStart;
_hookingFacadeException = null;
Thread.Sleep(kvp.Key);
try
{
using (GlobalInitializerFacade.CoreIsInitializedScope)
{
using (ThreadDataManager.EnsureInitialize())
{
HookingFacade.EnsureInitialization();
}
}
}
catch (Exception ex)
{
_hookingFacadeException = ex;
}
}
_hookingFacadeThread = null;
}