static void SetHostingEnvironment ()
{
bool shadow_copy_enabled = true;
HostingEnvironmentSection he = WebConfigurationManager.GetWebApplicationSection ("system.web/hostingEnvironment") as HostingEnvironmentSection;
if (he != null)
shadow_copy_enabled = he.ShadowCopyBinAssemblies;
if (shadow_copy_enabled) {
AppDomain current = AppDomain.CurrentDomain;
current.SetShadowCopyFiles ();
current.SetShadowCopyPath (current.SetupInformation.PrivateBinPath);
}
HostingEnvironment.IsHosted = true;
HostingEnvironment.SiteName = HostingEnvironment.ApplicationID;
}
#endif