Web Solutions/Intranets

SharePoint 2013 – Accessing referenced file from is not allowed because the reference is outside of the App Web

Scenario

I ran into this when deploying an event receiver that would update the master page of all sites (SPWeb objects) when activated in a particular site collection (SPSite object).
Accessing referenced file from is not allowed because the reference is outside of the App Web.

Problem

Better Resolution

I adapted this script to something a bit more readily reusable:  https://github.com/skaggej/powershell/blob/master/Set-SPAppWebMasterPages.ps1.  Just enter the root URL of a site collection and it will update the master pages for all app webs within it.

Leave a Reply

x

We use cookies to ensure the best possible experience on our website. Detailed information on the use of cookies on this site is provided in our Privacy and Cookie Policy. Further instruction on how to disable our cookies can be found there.