OneDrive / onedrive-sdk-csharp

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

File copy doesn't work when the destination path is in the same folder as the original file. #228

Open gandhiz opened 7 years ago

gandhiz commented 7 years ago

Hi,

The following code doesn't work when toParentFolderId is the same folder id as the original file:

var status = await client.ItemWithPath(fromPath).Copy(toFileName, new ItemReference {Id = toParentFolderId}).Request().PostAsync(); var item = await status.PollForOperationCompletionAsync(null, CancellationToken.None);

The error I get is:

Microsoft.Graph.ServiceException: Code: generalException Message: Unexpected exception returned from the service.

This error appears after I updated Microsoft.OneDriveSDK to the latest version.

Do you have the same issue?

Thanks.