Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 4
System.Web.Hosting
 CreateApplicationHost Method
Collapse All/Expand All Collapse All
.NET Framework Class Library
ApplicationHost..::.CreateApplicationHost Method

Creates and configures an application domain for hosting ASP.NET.

Namespace:  System.Web.Hosting
Assembly:  System.Web (in System.Web.dll)
Visual Basic
<SecurityPermissionAttribute(SecurityAction.Demand, Unrestricted := True)> _
Public Shared Function CreateApplicationHost ( _
    hostType As Type, _
    virtualDir As String, _
    physicalDir As String _
) As Object
C#
[SecurityPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]
public static Object CreateApplicationHost(
    Type hostType,
    string virtualDir,
    string physicalDir
)
Visual C++
[SecurityPermissionAttribute(SecurityAction::Demand, Unrestricted = true)]
public:
static Object^ CreateApplicationHost(
    Type^ hostType, 
    String^ virtualDir, 
    String^ physicalDir
)
F#
[<SecurityPermissionAttribute(SecurityAction.Demand, Unrestricted = true)>]
static member CreateApplicationHost : 
        hostType:Type * 
        virtualDir:string * 
        physicalDir:string -> Object 

Parameters

hostType
Type: System..::.Type
The name of a user-supplied class to be created in the new application domain.
virtualDir
Type: System..::.String
The virtual directory for the application domain; for example, /myapp.
physicalDir
Type: System..::.String
The physical directory for the application domain where ASP.NET pages are located; for example, c:\mypages.

Return Value

Type: System..::.Object
An instance of a user-supplied class used to marshal calls into the newly created application domain.
ExceptionCondition
PlatformNotSupportedException

The Web host computer is not running the Windows NT platform or a Coriolis environment.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Exceptions not document yet      Dongsheng   |   Edit   |   Show History
The hostType assembly must in the directory physicalDir/bin, otherwise an FileNotFoundException with message 'Could not load file or assembly' will be occurred.
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker