ApplicationManifest.CreateFromFile

ApplicationManifest.CreateFromFile

The CreateFromFile method creates an instance of an ApplicationManifest object from a specified application manifest file.

Syntax

[C#]

public static ApplicationManifest CreateFromFile(
  String fileName
);

Syntax

[Visual Basic .NET]

Public Shared Function CreateFromFile( _
  ByVal fileName As String _
) As ApplicationManifest

Parameters

  • FileName
    Specifies the name of the application manifest XML file, including the full path.

Return Values

This method returns a new ApplicationManifest object.

Remarks

This static method simply reads the supplied XML file and creates an ApplicationManifest object containing the XML content. To compile the application manifest and its associated MSPL script, the ApplicationManifest.Compile method must be called on the newly created ApplicationManifest object.

The application manifest file is interpreted only as either UTF-8 or Unicode format. If the file is UTF-8, the \uXXXX syntax must be used for special characters in string literals within the file. Otherwise, the file should be saved as Unicode.

Example Code

The following sample demonstrates how to load an application manifest XML source document into the ApplicationManifest object and compile it.

ApplicationManifest myAppManifest = ApplicationManifest.CreateFromFile("C:\\xmldocs\\my_app_manifest_xml_file.xml");

try {

myAppManifest.Compile();

}
catch (CompilerErrorException cee) {

Console.WriteLine("The following MSPL compiler errors occurred:");
 System.Collections.IEnumerator myEnumerator = cee.ErrorMessages.GetEnumerator();
 while  (myEnumerator.MoveNext())
Console.Write("\t{0}", myEnumerator.Current);
 Console.WriteLine();

}

Requirements

Redistributable: Requires Microsoft Lync Server 2010

Namespace:Microsoft.Rtc.Sip

Assembly: ServerAgent (in ServerAgent.dll)

See Also

Concepts

ApplicationManifest.Compile

ApplicationManifest.CreateFromString

ApplicationManifest