Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / Hosting / ApplicationHost.cs / 2 / 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.]
///
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
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.
//------------------------------------------------------------------------------
//
// 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.]
///
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TypedTableBaseExtensions.cs
- EncoderParameters.cs
- RelationshipEnd.cs
- StatusBarPanel.cs
- SmtpTransport.cs
- SettingsAttributes.cs
- DataTableNewRowEvent.cs
- ValidationRule.cs
- Point3DKeyFrameCollection.cs
- NameObjectCollectionBase.cs
- ConfigurationElementProperty.cs
- PropertyEmitter.cs
- RootDesignerSerializerAttribute.cs
- _NestedSingleAsyncResult.cs
- MessageDescription.cs
- Mutex.cs
- SystemThemeKey.cs
- DataGridColumnHeader.cs
- FamilyMap.cs
- UnsafeNativeMethods.cs
- CipherData.cs
- OneWayBindingElement.cs
- JavascriptCallbackBehaviorAttribute.cs
- ItemsPresenter.cs
- HttpRequestContext.cs
- PrincipalPermission.cs
- DataSet.cs
- SortExpressionBuilder.cs
- SystemIPGlobalProperties.cs
- FontStyle.cs
- WinInetCache.cs
- WorkItem.cs
- ExternalException.cs
- DESCryptoServiceProvider.cs
- HtmlCommandAdapter.cs
- AutoGeneratedField.cs
- ActiveDocumentEvent.cs
- ScrollBarAutomationPeer.cs
- UniqueIdentifierService.cs
- SiteMapNodeItemEventArgs.cs
- RegexCharClass.cs
- httpapplicationstate.cs
- BitmapEffectDrawingContent.cs
- NaturalLanguageHyphenator.cs
- CallbackValidatorAttribute.cs
- CompositionAdorner.cs
- PrintingPermission.cs
- AutoResetEvent.cs
- Input.cs
- CodeVariableDeclarationStatement.cs
- MimeFormImporter.cs
- NativeMethods.cs
- ServiceBehaviorElement.cs
- PrintControllerWithStatusDialog.cs
- XhtmlCssHandler.cs
- CharacterBuffer.cs
- FrameworkReadOnlyPropertyMetadata.cs
- SqlConnectionPoolProviderInfo.cs
- IODescriptionAttribute.cs
- AggregationMinMaxHelpers.cs
- Pair.cs
- XmlQueryContext.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- TableSectionStyle.cs
- SyndicationDeserializer.cs
- NameValueConfigurationElement.cs
- GenericEnumConverter.cs
- XmlSchemaType.cs
- UIEndRequest.cs
- ContentTextAutomationPeer.cs
- FormViewUpdatedEventArgs.cs
- NamespaceQuery.cs
- SafeNativeMethodsMilCoreApi.cs
- SqlTriggerAttribute.cs
- TabControlEvent.cs
- WebPartZoneAutoFormat.cs
- FixedPageProcessor.cs
- UniqueConstraint.cs
- TextCollapsingProperties.cs
- RepeaterItem.cs
- SmiEventSink_DeferedProcessing.cs
- SafeLibraryHandle.cs
- TimeSpanValidatorAttribute.cs
- BitmapInitialize.cs
- CollectionMarkupSerializer.cs
- SiteMapNodeItemEventArgs.cs
- ExtensionQuery.cs
- SecUtil.cs
- IndicFontClient.cs
- TextBoxDesigner.cs
- Resources.Designer.cs
- TCEAdapterGenerator.cs
- DataGridViewButtonColumn.cs
- MexNamedPipeBindingElement.cs
- HashCryptoHandle.cs
- SettingsProperty.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- GorillaCodec.cs
- LessThanOrEqual.cs
- COM2ExtendedBrowsingHandler.cs