GetManifestCompletedEventArgs.ApplicationManifest Property

Definition

Gets the ClickOnce application manifest for this deployment.

C#
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.

C#
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

Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1