【问题标题】:Create site collection using CSOM C# get error Value cannot be null. Parameter name: source使用 CSOM C# 创建网站集获取错误值不能为空。参数名称:来源
【发布时间】:2017-11-08 17:23:03
【问题描述】:

我编写了一些代码来通过 CSOM C# 创建网站集,以下代码运行良好。但最近(1、2 天前),它给了我“ServerException Value cannot be null.\r\nParameter name: source”,从那时起我无法再创建任何站点。

using (var tenantContext = new ClientContext("https://<Tenant>-admin.sharepoint.com"))
            {
                var password = ConvertToSecureString("my admin password");
                tenantContext.Credentials = new SharePointOnlineCredentials("my admin account", password);

                var tenant = new Tenant(tenantContext);
                var siteCreationProperties = new SiteCreationProperties();

                siteCreationProperties.Title = "Site 01";
                siteCreationProperties.Url = "https://<Tenant>.sharepoint.com/sites/site01";
                siteCreationProperties.Owner = "my admin account";

                var spo = tenant.CreateSite(siteCreationProperties);

                tenantContext.Load(spo, i => i.IsComplete);
                tenantContext.ExecuteQuery();
            }

还有例外:

ex  {"Value cannot be null.\r\nParameter name: source"} System.Exception 

{Microsoft.SharePoint.Client.ServerException} 数据 {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collections.ListDictionaryInternal} HResult -2146233088 int 帮助链接空字符串 内部异常 null System.Exception 消息“值不能为空。\r\n参数名称:源”字符串 ServerErrorCode -2147467261 int ServerErrorDetails 空对象 ServerErrorTraceCorrelationId "3a3ef99d-702c-3000-d2be-2391dc283133" 字符串 ServerErrorTypeName "System.ArgumentNullException" 字符串 ServerErrorValue 空字符串 ServerStackTrace "" 字符串 源“Microsoft.SharePoint.Client.Runtime”字符串 StackTrace " 在 Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)\r\n 在 Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()\r\n 在 Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb) \r\n 在 Microsoft.SharePoint.Client.ClientRequest.ExecuteQuery()\r\n 在 Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQuery()\r\n 在 Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()\r \n 在 ConsoleApplication1.Program.CreateSite() in....\ConsoleApplication1\Program.cs:line 79" 字符串

请帮我找出这个异常是什么以及如何解决它。

非常感谢和最好的问候,

大卫

【问题讨论】:

    标签: c# office365 sharepoint-online


    【解决方案1】:

    我们昨天遇到了同样的问题,并进行了大量研究来调查错误。但这只是我们的租户有问题。尝试在不同的租户上开始创建站点,看看是否可行。如果 SharePoint 存在问题,还请查看租户“管理员门户 => 服务运行状况”。

    希望能为您节省一些时间。

    【讨论】:

    • 您好,
      非常感谢您的回复,我尝试了不同的租户,但仍然出现错误。代码看起来不错,所以我认为问题与您所说的租户等其他部分有关,与服务器的连接,代理......仍在调查以找出根本原因。
      问候,大卫
    • 我们的租户也遇到了同样的错误。我认为 Microsoft 存在全局错误。
    • 嗨,/r/n 欲了解更多信息: - 当我在没有代理和免费互联网的情况下在家执行代码时,一切正常,创建的站点没有任何问题。 - 但是当我在有代理、证券......之类的公司运行代码时,该错误再次出现......
    • 我在一些租户中也看到了这个错误,但不是全部。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-23
    • 1970-01-01
    • 1970-01-01
    • 2019-06-12
    • 1970-01-01
    • 2020-08-03
    相关资源
    最近更新 更多