Share via


ServerManagementUnit.GetApplication(String, String) Method

Definition

Returns an application management unit for the specified site name and application path.

public:
 Microsoft::Web::Management::Server::ApplicationManagementUnit ^ GetApplication(System::String ^ siteName, System::String ^ applicationPath);
public Microsoft.Web.Management.Server.ApplicationManagementUnit GetApplication (string siteName, string applicationPath);
member this.GetApplication : string * string -> Microsoft.Web.Management.Server.ApplicationManagementUnit
Public Function GetApplication (siteName As String, applicationPath As String) As ApplicationManagementUnit

Parameters

siteName
String

The name of the site.

applicationPath
String

The application path.

Returns

An ApplicationManagementUnit object that contains application configuration information.

Exceptions

siteName or applicationPath is null.

siteName or applicationPath is "/".

Examples

The following example sends ServerManagementUnit information to the trace listener.

void traceMU() {

    ServerManagementUnit smu = ManagementUnit as ServerManagementUnit;

    if (smu != null) {
        string FMV = smu.FrameworkVersions.ToString();
        Trace.WriteLine("FrameworkVersions = " + FMV);
        Trace.WriteLine("MachineName = " + smu.MachineName);
        ApplicationManagementUnit amu =
            smu.GetApplication("rickaSite", "/ra");
        Trace.WriteLine("App FrameworkVersion = "
            + amu.FrameworkVersion.Text);
        SiteManagementUnit rickaSMU = smu.GetSite("rickaSite");
        string rwcp = rickaSMU.ConfigurationMap.RootWebConfigurationPath;
        Trace.WriteLine("RootWebConfigurationPath = " + rwcp);
        ManagementScope ms = smu.Scope;
        Trace.WriteLine("Scope = " + ms.ToString());


    } else {

        ApplicationManagementUnit appUnit = 
            ManagementUnit as ApplicationManagementUnit;
        if (appUnit != null)
            traceAppUnit();
    }

} 

Applies to