public static string MapPath(string virtualPath)
 {
     AspNetPartialTrustHelpers.FailIfInPartialTrustOutsideAspNet();
     return(HostingEnvironment.MapPath(virtualPath));
 }
 // demands SecurityPermission(Unrestricted) -- use Unsafe version to assert
 public static IDisposable Impersonate(IntPtr token)
 {
     AspNetPartialTrustHelpers.FailIfInPartialTrustOutsideAspNet();
     return(HostingEnvironment.Impersonate(token));
 }
 public static void IncrementBusyCount()
 {
     AspNetPartialTrustHelpers.FailIfInPartialTrustOutsideAspNet();
     HostingEnvironment.IncrementBusyCount();
 }
 public static void UnsafeUnregisterObject(IRegisteredObject target)
 {
     AspNetPartialTrustHelpers.FailIfInPartialTrustOutsideAspNet();
     HostingEnvironment.UnregisterObject(target);
 }