Share via


GetManifestCompletedEventArgs.ApplicationManifest Property

Definition

Gets the ClickOnce application manifest for this deployment.

public System.Xml.XmlReader ApplicationManifest { get; }

Property Value

An XmlReader representing the application manifest.

Examples

The following code example shows how to examine an application manifest from within a GetManifestCompleted event handler to determine whether the application requires full trust by default.

private bool CheckForFullTrust(XmlReader appManifest)
{
    if (appManifest == null)
    {
        throw (new ArgumentNullException("appManifest cannot be null."));
    }

    XAttribute xaUnrestricted =
        XDocument.Load(appManifest)
            .Element("{urn:schemas-microsoft-com:asm.v1}assembly")
            .Element("{urn:schemas-microsoft-com:asm.v2}trustInfo")
            .Element("{urn:schemas-microsoft-com:asm.v2}security")
            .Element("{urn:schemas-microsoft-com:asm.v2}applicationRequestMinimum")
            .Element("{urn:schemas-microsoft-com:asm.v2}PermissionSet")
            .Attribute("Unrestricted"); // Attributes never have a namespace

    if (xaUnrestricted != null)
        if (xaUnrestricted.Value == "true")
            return true;

    return false;
}

Remarks

You can use this variable to grab any information you need from the application manifest, such as a list of dependencies, trust information, and so on. For more information on the structure of this document, see ClickOnce Application Manifest.

Applies to