{"action":"created","issue":{"url":"https://api.github.com/repos/OneDrive/onedrive-sdk-csharp/issues/183","repository_url":"https://api.github.com/repos/OneDrive/onedrive-sdk-csharp","labels_url":"https://api.github.com/repos/OneDrive/onedrive-sdk-csharp/issues/183/labels{/name}","comments_url":"https://api.github.com/repos/OneDrive/onedrive-sdk-csharp/issues/183/comments","events_url":"https://api.github.com/repos/OneDrive/onedrive-sdk-csharp/issues/183/events","html_url":"https://github.com/OneDrive/onedrive-sdk-csharp/issues/183","id":183980905,"number":183,"title":"Copy() operation always throws Microsoft.Graph.ServiceException","user":{"login":"Kyrodan","id":355178,"avatar_url":"https://avatars.githubusercontent.com/u/355178?v=3","gravatar_id":"","url":"https://api.github.com/users/Kyrodan","html_url":"https://github.com/Kyrodan","followers_url":"https://api.github.com/users/Kyrodan/followers","following_url":"https://api.github.com/users/Kyrodan/following{/other_user}","gists_url":"https://api.github.com/users/Kyrodan/gists{/gist_id}","starred_url":"https://api.github.com/users/Kyrodan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kyrodan/subscriptions","organizations_url":"https://api.github.com/users/Kyrodan/orgs","repos_url":"https://api.github.com/users/Kyrodan/repos","events_url":"https://api.github.com/users/Kyrodan/events{/privacy}","received_events_url":"https://api.github.com/users/Kyrodan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OneDrive/onedrive-sdk-csharp/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-19T14:39:01Z","updated_at":"2016-10-21T07:17:35Z","closed_at":null,"body":"Used libraries:\r\n* Microsoft.OneDriveSDK: 2.0.3\r\n* Microsoft.Graph.Core: 1.1.1\r\n\r\nI tried to copy a file with this code:\r\n```csharp\r\nvar result = await api\r\n    .Drive\r\n    .Root\r\n    .ItemWithPath(sourcepath)\r\n    .Copy(destFilename, new ItemReference {Id = destItem.Id})\r\n    .Request()\r\n    .PostAsync();\r\n```\r\n\r\nAll I get is a `Microsoft.Graph.ServiceException`:\r\n```\r\n{\"Eine Ausnahme vom Typ \\\"Microsoft.Graph.ServiceException\\\" wurde ausgelöst.\"}\r\n    Data: {System.Collections.ListDictionaryInternal}\r\n    Error: {Code: invalidRequest\r\nThrow site: 621a.862f\r\nMessage: Cannot call Copy without the respond-async preference\r\n}\r\n    HResult: -2146233088\r\n    HelpLink: null\r\n    InnerException: null\r\n    Message: \"Eine Ausnahme vom Typ \\\"Microsoft.Graph.ServiceException\\\" wurde ausgelöst.\"\r\n    Source: \"Microsoft.Graph.Core\"\r\n    StackTrace: \"   bei Microsoft.Graph.HttpProvider.<SendAsync>d__19.MoveNext()\\r\\n--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---\\r\\n   bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   bei Microsoft.Graph.BaseRequest.<SendRequestAsync>d__34.MoveNext()\\r\\n--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---\\r\\n   bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   bei Microsoft.OneDrive.Sdk.ItemCopyRequest.<PostAsync>d__6.MoveNext()\\r\\n--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---\\r\\n   bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   bei System.Runtime.CompilerServic\r\nes.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   bei System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\\r\\n   bei KeeAnywhere.StorageProviders.OneDrive.OneDriveStorageProvider.<Copy>d__4.MoveNext() in D:\\\\Entwicklung\\\\KeeAnywhere\\\\KeeAnywhere\\\\StorageProviders\\\\OneDrive\\\\OneDriveStorageProvider.cs:Zeile 70.\"\r\n    TargetSite: {Void MoveNext()}\r\n```\r\n\r\nWhat can I do to copy an existing item with a new name to another folder?"},"comment":{"url":"https://api.github.com/repos/OneDrive/onedrive-sdk-csharp/issues/comments/255311513","html_url":"https://github.com/OneDrive/onedrive-sdk-csharp/issues/183#issuecomment-255311513","issue_url":"https://api.github.com/repos/OneDrive/onedrive-sdk-csharp/issues/183","id":255311513,"user":{"login":"Kyrodan","id":355178,"avatar_url":"https://avatars.githubusercontent.com/u/355178?v=3","gravatar_id":"","url":"https://api.github.com/users/Kyrodan","html_url":"https://github.com/Kyrodan","followers_url":"https://api.github.com/users/Kyrodan/followers","following_url":"https://api.github.com/users/Kyrodan/following{/other_user}","gists_url":"https://api.github.com/users/Kyrodan/gists{/gist_id}","starred_url":"https://api.github.com/users/Kyrodan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kyrodan/subscriptions","organizations_url":"https://api.github.com/users/Kyrodan/orgs","repos_url":"https://api.github.com/users/Kyrodan/repos","events_url":"https://api.github.com/users/Kyrodan/events{/privacy}","received_events_url":"https://api.github.com/users/Kyrodan/received_events","type":"User","site_admin":false},"created_at":"2016-10-21T07:17:35Z","updated_at":"2016-10-21T07:17:35Z","body":"After changing `new Option(...)` to `new HeaderOption(...)` it worked, the file gets copied.\r\n\r\nBut using the resulting AsyncMonitor always throws an exception.\r\nCode:\r\n```csharp\r\nvar item = await result.PollForOperationCompletionAsync(null, CancellationToken.None);\r\n```\r\n\r\nError:\r\n```\r\n{\"Eine Ausnahme vom Typ \\\"Microsoft.Graph.ServiceException\\\" wurde ausgelöst.\"}\r\n    Data: {System.Collections.ListDictionaryInternal}\r\n    Error: {Code: itemNotFound\r\nThrow site: 6930.fe44\r\nMessage: Item does not exist\r\n}\r\n    HResult: -2146233088\r\n    HelpLink: null\r\n    InnerException: null\r\n    Message: \"Eine Ausnahme vom Typ \\\"Microsoft.Graph.ServiceException\\\" wurde ausgelöst.\"\r\n    Source: \"Microsoft.Graph.Core\"\r\n    StackTrace: \"   bei Microsoft.Graph.HttpProvider.<SendAsync>d__19.MoveNext()\\r\\n--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---\\r\\n   bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   bei Microsoft.Graph.AsyncMonitor`1.<PollForOperationCompletionAsync>d__4.MoveNext()\\r\\n--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---\\r\\n   bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   bei System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\\r\\n   bei KeeAnywhere.StorageProviders.OneDrive.OneDriveStorageProvider.<Copy>d__4.MoveNext() in D:\\\\Entwicklung\\\\KeeAnywhere\\\\KeeAnywhere\\\\StorageProviders\\\\OneDrive\\\\OneDriveStorageProvider.cs:Zeile 83.\"\r\n    TargetSite: {Void MoveNext()}\r\n```\r\nThe copied file has been succesfully created, only the `AsyncMonitor` fails.\r\n"}}
{"actor":{"display_login":"Kyrodan"}}