OneDrive / onedrive-sdk-csharp

OneDrive SDK for C#! https://dev.onedrive.com
Other
294 stars 143 forks source link

'Microsoft.Graph.BasePostMethodRequestBuilder`1' Not Found #197

Closed Txusete closed 1 month ago

Txusete commented 8 years ago

Hello,

I'm trying to copy 1 file from OneDrive to another folder in OneDrive using the suggested method from the documentation for c#:

var asyncStatus = await FileManager.FileManager.SharedInstance.OneDriveDevice .Drive .Items[file.Id] .Copy(strDestinationName, new ItemReference { Id = destinationFolderID }) .Request() .PostAsync(); However this provoques the following exception: "Was not possible to load the type 'Microsoft.Graph.BasePostMethodRequestBuilder`1' from the assembly 'Microsoft.Graph.Core, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

I'm using Microsoft.OneDriveSDK v 2.0.6 and Microsoft.Graph.Core v=1.3.0.

I can copy files from OneDrive to Local and from Local to OneDrive, but i guess this type is not used for that. Is it possible that i'm missing some library? Thanks!

cdmayer commented 8 years ago

Something is fishy here. BasePostMethodRequsetBuilder was deprecated in Graph 1.2.1, and the OneDriveSDK was updated to reflect that as of 2.0.6. You should not be getting that exception if you are using the updated package. Can you try uninstalling and reinstalling the Nuget package to make sure you're on the correct version?

Txusete commented 8 years ago

Hello,

I reinstalled the Nuget package and looks like this issue was solved. However now i have a Microsoft.Graph.ServiceException. From a previous Issue i saw that a possible workaround was to include .Request(new[] { new Option("Prefer", "respond-async") }), but its not making any difference for me.

Below the full exception error in case it could be of any help:

`Error: at Microsoft.Graph.HttpProvider.d19.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.d34.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.OneDrive.Sdk.ItemCopyRequest.d__6.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.ValidateEnd(Task task) at CopyFilesHelper.CopyFiles.d__193.MoveNext() in Y:\Documents\DocumentsWin\Visual Studio 2015\Projects\SpeedyFiles_Git\SpeedyFiles\CopyFilesHelper\CopyFiles.cs:line 13645

Exception of type 'Microsoft.Graph.ServiceException' was thrown.`

baywet commented 1 month ago

Thank you for reaching out and for your patience. This SDK is being officially deprecated. See #259 for more information