Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Hosting / ApplicationHost.cs / 1305376 / ApplicationHost.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.Hosting {
using System;
using System.IO;
using System.Collections;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Runtime.Remoting;
using System.Web;
using System.Web.Configuration;
using System.Web.Util;
using System.Security.Permissions;
///
/// [To be supplied.]
///
public sealed class ApplicationHost {
private ApplicationHost() {
}
/*
* Creates new app domain for hosting of ASP.NET apps with a
* user defined 'host' object in it. The host is needed to make
* cross-domain calls to process requests in the host's app domain
*/
///
/// [To be supplied.]
///
[SecurityPermission(SecurityAction.Demand, Unrestricted=true)]
public static Object CreateApplicationHost(Type hostType, String virtualDir, String physicalDir) {
#if !FEATURE_PAL // FEATURE_PAL does not require PlatformID.Win32NT
if (Environment.OSVersion.Platform != PlatformID.Win32NT)
throw new PlatformNotSupportedException(SR.GetString(SR.RequiresNT));
#else // !FEATURE_PAL
// FEATURE_PAL
#endif // !FEATURE_PAL
if (!StringUtil.StringEndsWith(physicalDir, Path.DirectorySeparatorChar))
physicalDir = physicalDir + Path.DirectorySeparatorChar;
ApplicationManager appManager = ApplicationManager.GetApplicationManager();
String appId = (String.Concat(virtualDir, physicalDir).GetHashCode()).ToString("x");
ObjectHandle h = appManager.CreateInstanceInNewWorkerAppDomain(
hostType, appId, VirtualPath.CreateNonRelative(virtualDir), physicalDir);
return h.Unwrap();
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.Hosting {
using System;
using System.IO;
using System.Collections;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Runtime.Remoting;
using System.Web;
using System.Web.Configuration;
using System.Web.Util;
using System.Security.Permissions;
///
/// [To be supplied.]
///
public sealed class ApplicationHost {
private ApplicationHost() {
}
/*
* Creates new app domain for hosting of ASP.NET apps with a
* user defined 'host' object in it. The host is needed to make
* cross-domain calls to process requests in the host's app domain
*/
///
/// [To be supplied.]
///
[SecurityPermission(SecurityAction.Demand, Unrestricted=true)]
public static Object CreateApplicationHost(Type hostType, String virtualDir, String physicalDir) {
#if !FEATURE_PAL // FEATURE_PAL does not require PlatformID.Win32NT
if (Environment.OSVersion.Platform != PlatformID.Win32NT)
throw new PlatformNotSupportedException(SR.GetString(SR.RequiresNT));
#else // !FEATURE_PAL
// FEATURE_PAL
#endif // !FEATURE_PAL
if (!StringUtil.StringEndsWith(physicalDir, Path.DirectorySeparatorChar))
physicalDir = physicalDir + Path.DirectorySeparatorChar;
ApplicationManager appManager = ApplicationManager.GetApplicationManager();
String appId = (String.Concat(virtualDir, physicalDir).GetHashCode()).ToString("x");
ObjectHandle h = appManager.CreateInstanceInNewWorkerAppDomain(
hostType, appId, VirtualPath.CreateNonRelative(virtualDir), physicalDir);
return h.Unwrap();
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WebControlParameterProxy.cs
- HttpRequestWrapper.cs
- XmlStreamStore.cs
- StoreAnnotationsMap.cs
- RSAPKCS1KeyExchangeFormatter.cs
- HtmlButton.cs
- StylusPointDescription.cs
- Literal.cs
- PrivilegeNotHeldException.cs
- TextTreeText.cs
- XamlToRtfWriter.cs
- NGCUIElementCollectionSerializerAsync.cs
- Lease.cs
- HostAdapter.cs
- SiteMapHierarchicalDataSourceView.cs
- AttributeCollection.cs
- RecognizedAudio.cs
- EditingCoordinator.cs
- AppDomainEvidenceFactory.cs
- TaskbarItemInfo.cs
- UnauthorizedAccessException.cs
- CqlGenerator.cs
- AssemblyNameProxy.cs
- RepeaterItem.cs
- CodeSnippetTypeMember.cs
- SlipBehavior.cs
- SHA1CryptoServiceProvider.cs
- StateFinalizationDesigner.cs
- WebPartCloseVerb.cs
- XmlAttributeCache.cs
- BufferModeSettings.cs
- HyperLinkStyle.cs
- DBConcurrencyException.cs
- Setter.cs
- Propagator.ExtentPlaceholderCreator.cs
- MimeWriter.cs
- TailCallAnalyzer.cs
- ToolStripItemRenderEventArgs.cs
- ControlBuilder.cs
- SqlUserDefinedTypeAttribute.cs
- ImageAnimator.cs
- ActionItem.cs
- Empty.cs
- DocumentEventArgs.cs
- ShaperBuffers.cs
- GeneratedCodeAttribute.cs
- PageThemeParser.cs
- MarkupCompilePass2.cs
- ProxyFragment.cs
- ContentIterators.cs
- InspectionWorker.cs
- SourceChangedEventArgs.cs
- QueuePathDialog.cs
- DataBoundControlDesigner.cs
- ListBoxItemAutomationPeer.cs
- _Semaphore.cs
- SoapExtensionTypeElementCollection.cs
- New.cs
- CodeGenHelper.cs
- PropertyIDSet.cs
- SiteMapDataSourceView.cs
- PeerNameRecordCollection.cs
- ProxyElement.cs
- Underline.cs
- MatrixTransform3D.cs
- NamedElement.cs
- MaskPropertyEditor.cs
- ContextBase.cs
- PrintDialog.cs
- TrackingMemoryStream.cs
- Misc.cs
- DragDrop.cs
- SqlBuilder.cs
- BitmapEffectGroup.cs
- WebPartZoneBase.cs
- Vector3DConverter.cs
- PartialClassGenerationTaskInternal.cs
- _NTAuthentication.cs
- CircleEase.cs
- CodeConstructor.cs
- RouteItem.cs
- StrokeSerializer.cs
- Object.cs
- NavigatorOutput.cs
- PageSettings.cs
- ZipIOExtraFieldZip64Element.cs
- CanonicalFontFamilyReference.cs
- WindowInteropHelper.cs
- TransformationRules.cs
- DBDataPermissionAttribute.cs
- GridViewDeletedEventArgs.cs
- CodeGotoStatement.cs
- TextTreeDeleteContentUndoUnit.cs
- PropertyInfoSet.cs
- XmlDataImplementation.cs
- Literal.cs
- AssemblyResourceLoader.cs
- QueryOutputWriterV1.cs
- MimePart.cs
- _HeaderInfo.cs