标签: sharepoint-apps

SharePoint应用程序部署错误:"无法安装SharePoint应用程序"

当我尝试添加SharePoint mvc应用程序时,我收到以下错误:

Error occurred in deployment step 'Install app for SharePoint': 
Failed to install app for SharePoint. Please see the output window for details.
Run Code Online (Sandbox Code Playgroud)

详细的堆栈跟踪:

CorrelationId: 50583239-71cb-4b07-8bcb-4bbc51a22631
     ErrorDetail: There was a problem with activating the app web definition.
     ErrorType: App
     ErrorTypeName: App Related
     ExceptionMessage: Microsoft.SharePoint.SPException: Exception from HRESULT: 0x81070964 ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x81070964
at Microsoft.SharePoint.Library.SPRequestInternalClass.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext)
at Microsoft.SharePoint.Library.SPRequest.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback …
Run Code Online (Sandbox Code Playgroud)

deployment sharepoint sharepoint-2013 sharepoint-apps

14
推荐指数
3
解决办法
2万
查看次数

如何防止SharePoint 2013应用程序部件取消最小下载策略(MDS)

我发现SharePoint 2013 Online中的页面加载(尚未测试On-prem)从MDS回退到包含应用程序部分的任何页面的整页加载.

我发现这对于SharePoint托管应用程序部件和提供程序托管应用程序部件都是如此.

我已经简化了页面以删除所有但只是基本的html内容,以确保一些已知问题,如脚本链接,不会导致问题.

作为测试的一部分,我确认MDS正在为网站上的其他页面运行(例如:从一个文档库导航到另一个文档库).

我已经阅读了一些关于MDS后备的文章,

我没有看到有人提到应用程序部分将取消MDS.

这里有一些我觉得有用的帖子.

http://steve.thelineberrys.com/gotchas-using-custom-web-parts-and-the-minimal-download-strategy/ http://www.wictorwilen.se/sharepoint-2013---introduction-to-在-最小下载策略-MDS

编辑:我创建了一个MDS后备的小提琴曲.作为回复的一部分,我没有看到任何错误.跟踪可以在http://1drv.ms/1pWrlx3下载.

sharepoint-2013 sharepoint-apps

6
推荐指数
1
解决办法
1076
查看次数

SPAppToken(上下文标记)为null

我有一个Sharepoint 2013内部部署环境,我正在使用Visual Studio开发一个提供者托管应用程序.

Visual Studio项目有一个应用程序项目,其中包含一个转到Web项目的自定义功能区按钮.Web项目托管在Windows Azure上,在这里我得到上下文令牌为空或空字符串的错误.

使用以下代码完成令牌:

var contextTokenString = TokenHelper.GetContextTokenFromRequest(Request);
SharePointContextToken contextToken =
     TokenHelper.ReadAndValidateContextToken
                             (contextTokenString, Request.Url.Authority);
Run Code Online (Sandbox Code Playgroud)

当我看到传递给Azure上托管的站点的内容时,我注意到它SPAppToken是null.使用ULS查看器时,我收到错误" Azure Access Control服务不可用 "

我已经检查了应用程序是否已注册(使用appregnew.aspx),并且该文件appManifest.xmlweb.config文件中的ID相同.

如何获取上下文令牌?我是否需要在Azure中执行其他操作才能使其正常工作?

sharepoint token azure sharepoint-2013 sharepoint-apps

5
推荐指数
1
解决办法
4318
查看次数

如何在asp.net mvc应用程序中附加APPS的sharepoint所需参数?

根据sharepoint应用程序的文档,我们需要始终附加SP主机Web URL,以便应用程序可以从主机Web获取上下文.

Sharepoint Context提供程序和令牌帮助类自动检测此查询字符串值并创建上下文.

在我的asp.net mvc sharepoint应用程序中,我有以下代码:

 public ActionResult InstallDesignPackage()
{
    // Use TokenHelper to get the client context and Title property.
    // To access other properties, the app may need to request permissions
    // on the host web.
    var spContext = SharePointContextProvider.Current.GetSharePointContext(HttpContext);
    // Publishing feature GUID to use the infrastructure for publishing
    Guid PublishingFeature = Guid.Parse("f6924d36-2fa8-4f0b-b16d-06b7250180fa");
    // The site-relative URL of the design package to install.
    // This sandbox design package should be uploaded to a document library
    // …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc sharepoint sharepoint-apps

5
推荐指数
1
解决办法
2913
查看次数

如何取消注册或更新已注册的SharePoint应用程序

我有一个应用程序将在我的SharePoint租户中使用.从App开发者我获得了客户端ID,客户端密钥,App域,返回Url.

在通过Appregnew.aspx进行应用程序注册期间,我使用了错误的返回URL和客户端密钥.现在,如果我点击该应用程序,它会抛出错误"发生错误....".

要使用该应用程序,我需要使用正确的客户端密钥更新我的注册应用程序并返回URL.我找不到任何方法..如何更新或取消注册SharePoint应用程序.

sharepoint-apps

5
推荐指数
3
解决办法
1万
查看次数

在sharepoint加载项中检索查询字符串

我正在开发一个Sharepoint 2013加载项,我需要检索原始请求的查询字符串.

用户通过电子邮件链接到我们的加载项,我们需要提供一些上下文.请求加载项如下:https: //x.sharepoint.com/MyAddIn?p = 10

是否可以在我的加载项中检索p的值?

sharepoint sharepoint-2013 sharepoint-apps

5
推荐指数
1
解决办法
904
查看次数

如何获取仅限 Sharepoint 应用程序模型的刷新令牌?

我们有客户要求使用仅共享点应用程序模型对共享点进行在线身份验证。通过向 Microsoft Azure ACS 发布请求来获取访问令牌,” https://accounts.accesscontrol.windows.net/cde6fa59-abb3-4971-be01 -2443c417abcd/tokens/OAuth/2”,使用 postman 工具在请求正文中包含 client_credentials。

访问令牌过期后,如何获取刷新令牌?

从上面的请求中,我们只获得访问令牌。我们是否有一个单独的端点来检索刷新令牌。

请帮忙。在此输入图像描述

oauth acs sharepoint-apps sharepoint-online

5
推荐指数
1
解决办法
680
查看次数

未捕获的ReferenceError:未在sp.runtime.js中定义类型

我正在尝试使用Office PnP中的分类法Picker示例.

我只想将一个字段绑定到一个托管元数据术语.

我得到的错误在这里:http: //screencast.com/t/nOaTusUH4V

我的代码是:

<head>
    <meta charset="utf-8" />
    <title>Learning bootstrap</title>    
    <meta name="viewport" content="width=device-width, initial-scale=1">   

    <link href="../Content/bootstrap.min.css" rel="stylesheet" /> 
    <link href="../Content/bootstrap-theme.min.css" rel="stylesheet" />
    <link rel="Stylesheet" type="text/css" href="../Content/taxonomypickercontrol.css" />
    <script src="../Scripts/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="/_layouts/15/sp.runtime.js"></script>
    <script type="text/javascript" src="/_layouts/15/sp.js"></script>

    <script src="../Scripts/app.js" type="text/javascript"></script>
    <script src="../Scripts/taxonomypickercontrol.js" type="text/javascript"></script>
</head>


body>
    <div id="divSPChrome"></div>
    <div class="container">      
        <div class="row">
            <div class="col-md-8">
                <h2>Create project site</h2>
                <form class="form-horizontal" role="form">
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">Project name</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="inputEmail3" placeholder="Project name">
                        </div>
                    </div>
                    <div class="form-group"> …
Run Code Online (Sandbox Code Playgroud)

javascript sharepoint jquery officedev sharepoint-apps

4
推荐指数
1
解决办法
2万
查看次数

根据标题更改表格单元格的背景颜色

我正在 javascript 中动态构建日历(html 表)。我想要带有灰色背景颜色的周六和周日列。

当我将其他单元格添加到日历时,我想检查单元格列标题,检查它的内部 html text/class/id 并在周末为单元格着色。

这是我添加带有日期起始字母的列标题的地方:

<th bgcolor='#c1c1c1' width=20>S</th>" 
<th width=20>M</th>" 
<th width=20>T</th>" 
<th width=20>W</th>" 
<th width=20>T</th>" 
<th width=20>F</th>" 
<th bgcolor='#c1c1c1' width=20>S</th>" 
Run Code Online (Sandbox Code Playgroud)

我试过这段代码,但它不能正常工作......

var table = document.getElementById("calendarTable");
var rows = table.getElementsByTagName("tr");
for (var z = 0; z < rows.length-1; z++) {
    for (var y = 0; y < rows[z].cells.length; y++) {
        if(rows[z].cells[y].headers=="S")
            rows[z].cells[y].style.backgroundColor = "#c1c1c1";
    }
}
Run Code Online (Sandbox Code Playgroud)

所以我想要实现的只是一个小代码片段,它遍历整个表格元素,并检查每个单元格标题的innerhtml内容或id,并相应地更改它的背景颜色。

后来编辑:

表格截图:

在此处输入图片说明

问题是,该表是根据我们当前所在的月份构建的,我们不一定知道星期六或星期日的索引。(图中12月1日是星期一,所以这是一个非常幸运的情况)

周六和周日在表中不固定。日历从当月的第一天开始,然后获取它的日期。我知道这有点奇怪,但这就是其他人设计的方式,我必须使用它。

蓝条标记了一个时间间隔,但那个东西已经在起作用了。

我构建整个表的代码会很长,以使其易于理解。

html javascript css html-table sharepoint-apps

4
推荐指数
1
解决办法
2万
查看次数

使用Sonar MSBuild Runner和/ p:IsPackaging = True

我有一个Visual Studio Team Services构建定义,其中包含由Sonar Begin Analysis和End Analysis任务包围的Visual Studio Build任务.Visual Studio Build使用/ p:IsPackaging = True属性打包SharePoint提供程序托管的加载项.如果设置了此属性,则会从Sonar Build Runner中收到以下错误:

2015-11-27T13:23:05.9534586Z WARNING: Duplicate project GUID: "31ef7995-fdbc-4307-9024-a3d640fdf987". 
Check that the project is only being built for a single platform/configuration and that that 
the project guid is unique. The project will not be analyzed by SonarQube. 
Run Code Online (Sandbox Code Playgroud)

当然,我可以首先构建没有/ p的解决方案:IsPackaging = True并在此处运行分析,然后在第二步中进行打包,但这似乎浪费了必须两次构建解决方案的资源.

知道我如何打包SharePoint提供程序托管加载项并使用相同的任务与Sonar进行代码分析?

使用的声纳版本是5.1.2.VSTS任务使用的MSBuild.SonarQube.Runner版本是1.0.1.

sonar-runner sharepoint-apps sonarqube sonarqube-msbuild-runner azure-pipelines

3
推荐指数
1
解决办法
1073
查看次数

未捕获错误:属性或字段尚未初始化

我试图在一个简单的sharepoint应用程序中运行以下代码,但我收到此错误:

Uncaught Error: The property or field has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested. 
Run Code Online (Sandbox Code Playgroud)

代码就是这个:

var collListItems;
$(document).ready(function () {
    getConfigValues();
});
function getConfigValues() {
    var context = SP.ClientContext.get_current();
    var configList = context.get_web().get_lists().getByTitle('Configuration Values');
    var camlQuery = new SP.CamlQuery();
    collListItems = configList.getItems(camlQuery);
    context.load(collListItems);
    context.executeQueryAsync(onGetConfigValuesSuccess, onGetConfigValuesFail);
}
function onGetConfigValuesSuccess() {
    var OrgLogoUrl;
    var OrgName;
    var listItemEnumerator = collListItems.getEnumerator();
    while (listItemEnumerator.moveNext()) {
        var oListItem = listItemEnumerator.get_current(); …
Run Code Online (Sandbox Code Playgroud)

javascript sharepoint sharepoint-apps

2
推荐指数
1
解决办法
2万
查看次数

确定输入的值是用户还是组 - 客户端对象模型

我正在尝试使用 SharePoint Online 的客户端对象模型和应用程序。我可以使用 FieldUserValue 对象从人员和组字段中检索信息,但是,如何从中确定输入的值只是用户还是 SharePoint 组?

据我所知, FieldUserValue 只有一个 LookupId 和 LookupValue 作为它的属性,它没有指定它是否是一个组。我是否在这方面走错了路,是否有更好的方法来查询该字段并检查该值是否是 SharePoint 组的用户?

谢谢

sharepoint csom sharepoint-apps sharepoint-online

2
推荐指数
1
解决办法
2593
查看次数

如何解决错误消息:从内部部署SharePoint 2013服务器启动应用程序时,"RegisterSod"未定义

我已经为SharePoint 2013创建了一个示例App并成功部署了它.启动应用程序时,我收到调用RegisterSod的每行代码都会出现以下错误

Message: 'RegisterSod' is undefined
Line: 14
Char: 1
Code: 0


<script type="text/javascript">RegisterSod("initstrings.js", "\u002f_layouts\u002f15\u002f1033\u002finitstrings.js?rev=uNmvBiHdrBzcPQzXRpm\u00252FnQ\u00253D\u00253D");</script>
<script type="text/javascript">RegisterSod("strings.js", "\u002f_layouts\u002f15\u002f1033\u002fstrings.js?rev=cSu1pcWiRc999fyCNzJplg\u00253D\u00253D");RegisterSodDep("strings.js", "initstrings.js");</script>
Run Code Online (Sandbox Code Playgroud)

反正这个问题可以解决吗?

sharepoint sharepoint-2013 sharepoint-apps

0
推荐指数
1
解决办法
7156
查看次数