Summary: Learn how to use the cross-domain library in apps for SharePoint to read items in a list hosted in the app web.
Last modified: May 28, 2014
Description of the sample
The code that uses the cross-domain library is in the CrossDomainCall.aspx file of the CrossDomainWeb project. Figure 1 shows the CrossDomainCall.aspx page of the app after you install and run the app.
This sample requires the following:
Visual Studio 2012
Office Developer Tools for Visual Studio 2012
A SharePoint 2013 development environment (app isolation required for on-premises scenarios)
For more information, see Get started developing apps for SharePoint.
Key components of the sample
The sample contains the following:
CrossDomainApp project, which contains the AppManifest.xml file
Configure the sample
Follow these steps to configure the sample.
Update the SiteUrl property of the solution with the URL of the home page of your SharePoint website.
Run and test the sample
Press F5 to build and deploy the app.
Choose Trust It on the consent page to grant permissions to the app.
You should see an HTML page that displays five announcements.
For troubleshooting steps, visit the Troubleshooting the solution table in the cross-domain library documentation article.
First version: July 2012
Updated version: October 2013. Changed the start page of the project to an ASPX page that works better with provider-hosted apps.
2nd version: May 2014