Sharepoint 托管 APP 的自定义母版页

Custom Master page for Sharepoint hosted APP

我有一个自定义母版页。我希望将此母版页应用于应用程序(SharePoint 托管)。该应用程序包含一个 aspx 页面 (Default.aspx)。

默认情况下,Default.aspx继承母版页如下:

<%@ Page Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" 
    MasterPageFile="~masterurl/default.master" Language="C#" %>

当我如下添加对继承 seattle.Master 的引用时 - seattle.master 完美应用于应用程序:

<%@ Page Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" 
    MasterPageFile="~site/_catalogs/masterpage/seattle.master"Language="C#" %>

同样,如果我应用我的自定义母版页(下面是代码),它不起作用。应用程序抛出文件未找到错误。

<%@ Page Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" 
    MasterPageFile="~site/_catalogs/masterpage/Custom.master"Language="C#" %>

注意:seattle.Master 和 Custom.Master(西雅图主页的副本)位于同一位置。

许多文章建议我们创建一个带有母版页的模块并进行部署。 (http://anthony-verschraegen.blogspot.com/2013/03/sharepoint-2013-apps-custom-app-master.html?_sm_au_=iVVRQfD1Zms2VTZr)

我的问题是当 /_catalogs/masterpage 位置有母版页时为什么我们需要一个模块?

我必须在多个 SharePoint 托管应用程序中重复使用自定义母版页。

请推荐

如果您参考 seattle.Master 母版页,它会起作用,因为该母版页位于应用程序网络中。你可以做个测试,修改Host Web中的seattle.Master,看看add-in是否适用。

您在主机 Web 中的自定义母版页,因此它在 add-in 中不起作用。

因此,我们需要创建一个带有母版页的模块,它将母版页部署到应用程序网络中。