Microsoft Graph APIを使用して既存のDriveItemの内容を使用して新しいSharePoint DriveItemを作成しようとしています。しかし、DriveItemを作成しようとすると、以下のエラーが表示されます。なぜ誰かが説明できますか?DriveItem作成時に "ReadTimeoutから値を取得中にエラーが発生しました"
編集:は手動で作成したのMemoryStreamオブジェクト
GraphServiceClient graphClient = GraphSDKHelper.GetAuthenticatedClient();
using (var docStream = new MemoryStream(1024))
{
var doc = new DriveItem
{
Content = docStream,
Name = "00_newDoc.docx",
ParentReference = new ItemReference
{
Id = "<folderId"
}
};
var resultItem = await graphClient.Drives["<driveId>"].Items["<folderId>"].Request().CreateAsync(driveItem);
}
を使用するために簡素化された、私は次のように直接ファイルのコンテンツをアップロードすることができますが、私はその後、単一でDriveItemに多くのメタデータを指定する能力を失いますコール。
var resultItem = await graphClient.Drives["<driveId>"].Items["<folderId>"].ItemWithPath("00_newDoc.docx").content.Request().PutAsync<DriveItem(docStream);
エラー:
Error getting value from 'ReadTimeout' on 'System.IO.MemoryStream'.
at Newtonsoft.Json.Serialization.DynamicValueProvider.GetValue(Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType) at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType) at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer) at Microsoft.Graph.Serializer.SerializeObject(Object serializeableObject) at Microsoft.Graph.BaseRequest.d__36.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Graph.BaseRequest.d__321.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Graph.DriveItemRequest.<CreateAsync>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter
1.GetResult() at Informa.eDocs.AzureFunctions.Functions.PostDocToSharePoint.d__0.MoveNext()
内部例外:
Timeouts are not supported on this stream. at System.IO.Stream.get_ReadTimeout() at GetReadTimeout(Object) at Newtonsoft.Json.Serialization.DynamicValueProvider.GetValue(Object target)
私は明確にすべきでした - 私はコピー機能を認識しています。これは、グラフAPIを使用して取得およびアップロードできることを示すPOCの一部に過ぎません。私の主な関心事は、私が記述した方法で新しいDriveItemを作成できない理由です。 – NSouth