How to: Create External Application XML Markup

Applies to: SharePoint Foundation 2010

This article explains how to use External Application XML to describe your Silverlight application to SharePoint Foundation so that it can manage the application’s access to data and render a Web Part that hosts the application.


External Application XML is markup that provides information to SharePoint Foundation about a Silverlight application that is hosted in a Web Part. The markup is only required if the Silverlight application is hosted on a different domain and accesses data from the SharePoint Web site. It can also be used, although it is not required, whenever a SharePoint External Application Provider (EAP) is being used. There are three categories of information in the markup:

  • Identifying information about the Silverlight application and the user name it uses to get data from the SharePoint Web site.

  • Information about the Web Part that hosts the external application.

  • Custom information that can be used by a custom EAP to register the application.

There is more than one way to assign the markup to the Web Part:

  • The markup can be assigned to the Web Part in the SharePoint Foundation UI at the time the Web Part is added to a page. If your Silverlight Web Part solution will use that method, you will need to provide the markup as a file with instructions to users on how to insert it, possibly with local modifications, using the UI.

  • You can also specify the markup as an Application XML property within the Web Part markup of a module in a feature definition (elements.xml) or site definition (onet.xml).

  • Finally, you can set the ApplicationXml property programmatically in, for example, a FeatureInstalled(SPFeatureReceiverProperties) or FeatureActivated(SPFeatureReceiverProperties) event.

Examples of External Application XML

The following is an example of External Application XML markup. For detailed information about the elements and attributes, see External Application XML. UTF-16 is used as the encoding in this example, but you can use any encoding. The children of the <customProperties> element can be any XML markup. If you use custom properties, then you must create a custom EAP to read and process the custom properties.

<?xml version='1.0' encoding='utf-16'?>
<applicationParts xmlns=''>
        <property name='Title'>Title</property>
        <property name='Description'>Description</property>
        <property name='WindowlessMode'>TRUE</property>
        <property name='Height'>200px</property>
        <property name='Width'>100px</property>
        <property name='HelpUrl'></property>
        <property name='HelpMode'>Modal</property>
        <property name='Direction'>NotSet</property>
        <property name='MinRuntimeVersion'>3.0</property>
        <property name='CustomPropertyName'>CustomPropertyInfo </property>

The following is an example of External Application XML inside an <AllUsersWebPart> element in either an elements.xml or an onet.xml file.

<AllUsersWebPart WebPartZoneID="Top_Right" WebPartOrder="2">
  <webPart xmlns="">
      <type name="Microsoft.SharePoint.WebPartPages.SilverlightWebPart, Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
      <importErrorMessage>Cannot import this Web Part.</importErrorMessage>
        <property name="ChromeType" type="chrometype">Default</property>
        <property name="Height" type="unit">600px</property>
        <property name="Url" type="string" />
        <property name="HelpMode" type="helpmode">Navigate</property>
        <property name="ApplicationXml" type="string">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;applicationParts xmlns=""&gt;
        <property name="Hidden" type="bool">False</property>
        <property name="Title" type="string" />