对于Sharepoint.com托管的应用程序,未定义RegisterSod

时间:2016-06-06 09:32:23

标签: sharepoint sharepoint-2013 sharepoint-apps

我已经创建了一个可以作为独立应用程序运行的Sharepoint应用程序,但是当我将其转换为应用程序部分时,它会失败,因为所有与Sharepoint相关的内容都是未定义的,就好像init.js以某种方式未加载一样。特别是错误控制台显示“RegisterSod未定义”。

很多人遇到了同样的问题并找到了相同的解决方案:

解决方案是在“站点管理”中“创建根站点”。

但是,他们的所有案例都适用于本地托管的Sharepoint。我的应用程序托管在sharepoint.com(ourcompany.sharepoint.com)上,我不确定它是否具有“创建根网站”的能力。在任何情况下,如果我将应用程序发布到Microsoft Store,用户将无法对此进行配置,因此我认为应用程序必须以某种方式在没有这个的情况下工作。

我不确定代码段在这里是否有用,但无论如何,我的应用程序部分页面从这开始:

<%@ Page language="C#" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<WebPartPages:AllowFraming ID="AllowFraming" runat="server" />

<html>
<head>
<title></title>
<script type="text/javascript" src="/_layouts/15/sp.runtime.js"></script>
<script type="text/javascript" src="/_layouts/15/sp.js"></script>

控制台有大约10条相同的消息:

My%20Web%20Part.aspx:18 Uncaught ReferenceError: RegisterSod is not defined

生成错误的页面实际上不是我的代码,但似乎是Microsoft生成的错误页面。

同样,它作为独立的sharepoint应用程序运行良好,但作为Web部件失败。

有什么想法吗?我很乐意提供更多信息。谢谢。

0 个答案:

没有答案
相关问题