public void ActivateInCurrentThread() { if (CurrentContext != null) { if (CurrentContext is GlobalContext) { CurrentContext.Deactivate(); } else { throw new InvalidOperationException(); } } if (!Activate()) { throw new Exception("Unable to activate base context"); } }