I am working on a SharePoint hosted app. It runs fine when loaded by clicking on the app icon in Site Contents page. But when I add it to a page with client web part, it is stuck on the 'Working on it' loading message. The message logged in console says "SharePoint hosted app part is not loaded with error "Refused to display in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'"

is the url of the app. It is usually on a different domain like "https://tenant-89b6750c1b31e3.sharepoint.com/sites/dev/...".

The app contains nothing. Just a very new app.

Also, I tried to figure out whether it is a server issue or page issue. I created an auto-hosted app for that. And the same way I added a client web part and added to the same page. And it works. As I believe the auto-hosted apps also run from different domain ( somewhere in Azure ).

So, why won't the SharePoint hosted app run?

The difference I could locate is that - Auto hosted app runs from Azure website, while SharePoint hosted runs from some SharePoint hosted sub web under same tenant.

Had anyone faced the same issue, and resolved? How?

1 Answer 1


Add the following to the app page you want to display in an app part:

<WebPartPages:AllowFraming ID="AllowFraming" runat="server" />
  • I was looking for a programmatic way. Do you believe it could anyhow be possible to achieve rather than a manual process?
    – Bishnu Das
    Jun 27, 2014 at 6:22
  • I don't see why a programmatic method is necessary; you can create a new page for an app part (create a new web part, select to create a page), and that gets added automatically.
    – wjervis
    Jun 27, 2014 at 10:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.