我有以下代码直到最近都运行良好
private async Task<DriveItem> CreateFolderIfNotExists(GraphServiceClient graphClient, string driveId, string folderName)
{
try
{
var driveItem = new DriveItem
{
Name = folderName,
Folder = new Folder(),
AdditionalData = new Dictionary<string, object>()
{
{ "@microsoft.graph.conflictBehavior", "fail" }
}
};
return await graphClient.Drives[driveId].Root.Children
.Request()
.AddAsync(driveItem);
}
catch (ServiceException exception)
{
if (exception.StatusCode != HttpStatusCode.Conflict)
{
throw;
}
return await this.GetFolderItem(graphClient, driveId, folderName);
}
}
突然间我们得到了这个:
<块引用>System.NullReferenceException:未将对象引用设置为对象的实例。在 Microsoft.Graph.HttpProvider.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancelationToken) 在 Microsoft.Graph.BaseRequest.SendRequestAsync(Object serializableObject, CancellationToken cancelationToken, HttpCompletionOption completionOption) 在 Microsoft.Graph.BaseRequest.SendAsync[T](Object serializableObject , CancellationToken CancellationToken, HttpCompletionOption completionOption) at xyz.CreateFolderIfNotExists(GraphServiceClient graphClient, String driveId, String folderName) in xyz\Client\SharePointClient.cs:line 63 at xyz.Client.SharePointClient.CopyLegacyFile(String fileId, String destination, String newFileName, String documentLibraryId) xyz\Client\SharePointClient.cs:line 222 at xyz.SharePointDocumentStorage.New() in xtz\SharePointDocumentStorage.cs:line 56 at zzzWorkflowAppService.NewRevision(NewRevisionInput input) at Abp.Authorization.AuthorizationInterceptor.InternalInterceptAsynchronous[T Result](IInvocation invocation) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Abp.EntityHistory.EntityHistoryInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Abp.Auditing.AuditingInterceptor.InternalResultInterceptor[TResult](IInvocation invocation) IInvocation 调用)在 Abp.Runtime.Validation.Interception.ValidationInterceptor.InternalInterceptAsynchronou...
知道发生了什么吗?没有代码推送导致这种情况。
的副本答案 0 :(得分:0)
看起来我的 microsoft Graph 版本是 1.21.0 版本需要升级。一定是由 MS 托管的重大更改。
它可能与这个问题有关https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/901