Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/263.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 无法使用图形更新团体照片_C#_Microsoft Graph Api - Fatal编程技术网

C# 无法使用图形更新团体照片

C# 无法使用图形更新团体照片,c#,microsoft-graph-api,C#,Microsoft Graph Api,我正在尝试使用Graph API更新Office 365统一组的照片: await _graphClient.Groups[groupId].Photo.Content.Request().PutAsync(photoStream); 当我尝试使用应用程序权限令牌调用此方法时,我得到: Microsoft.Graph.ServiceException:'代码:ErrorAccessDenied 消息:访问被拒绝。请检查凭据,然后重试 当我尝试使用委托令牌调用此方法时,我得到: Microsof

我正在尝试使用Graph API更新Office 365统一组的照片:

await _graphClient.Groups[groupId].Photo.Content.Request().PutAsync(photoStream);
当我尝试使用应用程序权限令牌调用此方法时,我得到:

Microsoft.Graph.ServiceException:'代码:ErrorAccessDenied 消息:访问被拒绝。请检查凭据,然后重试

当我尝试使用委托令牌调用此方法时,我得到:

Microsoft.Graph.ServiceException:'代码:ErrorItemNotFound 消息:在存储中找不到指定的对象。不存在类为“IPM.UserPhoto.Preview”的照片

Azure AD应用程序已授予“读取和写入所有组”的授权和应用程序权限,如中所述


更新组的标题和说明正在使用这两种方法(应用程序和委派)。

使用委派令牌时发生错误,原因是memorystream以某种方式损坏。它在更改流对象的加载后工作。错误消息是错误的

我仍然不确定在这种情况下为什么委托令牌不起作用