One or more errors occurred using google drive api

Hi,
I am trying to use the Google Drive API in my C# application with the below code but getting the following error:
System.AggregateException was unhandled
HResult=-2146233088
Message=One or more errors occurred.
Source=mscorlib
StackTrace:
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at WindowsFormsApplication1.frmMain.btnUpload_Click(Object sender, EventArgs e) in c:\Users\CakeBoutique\Documents\Visual Studio 2012\Projects\WindowsFormsApplication1\WindowsFormsApplication1\main_form.cs:line 35
at System.Windows.Forms.Control.OnClick(EventArgs e)
at DevExpress.XtraEditors.BaseButton.OnClick(EventArgs e)
at DevExpress.XtraEditors.BaseButton.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at DevExpress.Utils.Controls.ControlBase.WndProc(Message& m)
at DevExpress.XtraEditors.BaseControl.WndProc(Message& msg)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at WindowsFormsApplication1.Program.Main() in c:\Users\CakeBoutique\Documents\Visual Studio 2012\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Program.cs:line 26
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.IO.FileNotFoundException
HResult=-2147024894
Message=Could not load file or assembly 'Microsoft.Threading.Tasks.Extensions.Desktop, Version=1.0.16.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Source=Microsoft.Threading.Tasks
FileName=Microsoft.Threading.Tasks.Extensions.Desktop, Version=1.0.16.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
FusionLog==== Pre-bind state information ===
LOG: User = JASSIM-RAHMA\CakeBoutique
LOG: DisplayName = Microsoft.Threading.Tasks.Extensions.Desktop, Version=1.0.16.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/Users/CakeBoutique/documents/visual studio 2012/Projects/WindowsFormsApplication1/WindowsFormsApplication1/bin/Release/
LOG: Initial PrivatePath = NULL
Calling assembly : Google.Apis.Auth.PlatformServices, Version=1.8.1.31699, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\CakeBoutique\documents\visual studio 2012\Projects\WindowsFormsApplication1\WindowsFormsApplication1\bin\Release\WindowsFormsApplication1.vshost.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.Threading.Tasks.Extensions.Desktop, Version=1.0.16.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: Attempting download of new URL file:///C:/Users/CakeBoutique/documents/visual studio 2012/Projects/WindowsFormsApplication1/WindowsFormsApplication1/bin/Release/Microsoft.Threading.Tasks.Extensions.Desktop.DLL.
LOG: Attempting download of new URL file:///C:/Users/CakeBoutique/documents/visual studio 2012/Projects/WindowsFormsApplication1/WindowsFormsApplication1/bin/Release/Microsoft.Threading.Tasks.Extensions.Desktop/Microsoft.Threading.Tasks.Extensions.Desktop.DLL.
LOG: Attempting download of new URL file:///C:/Users/CakeBoutique/documents/visual studio 2012/Projects/WindowsFormsApplication1/WindowsFormsApplication1/bin/Release/Microsoft.Threading.Tasks.Extensions.Desktop.EXE.
LOG: Attempting download of new URL file:///C:/Users/CakeBoutique/documents/visual studio 2012/Projects/WindowsFormsApplication1/WindowsFormsApplication1/bin/Release/Microsoft.Threading.Tasks.Extensions.Desktop/Microsoft.Threading.Tasks.Extensions.Desktop.EXE.
StackTrace:
at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)
at Microsoft.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Google.Apis.Auth.OAuth2.GoogleWebAuthorizationBroker.<AuthorizeAsync>d__1.MoveNext() in c:\code\google.com\google-api-dotnet-client\default\Tools\Google.Apis.Release\bin\Debug\output\default\Src\GoogleApis.Auth.DotNet4\OAuth2\GoogleWebAuthorizationBroker.cs:line 54
InnerException:
here is the code:
UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
new ClientSecrets
ClientId = "xxxxxxxxx",
ClientSecret = "xxxxxxxxx",
new[] { DriveService.Scope.Drive },
"user",
CancellationToken.None).Result;
// Create the service.
var service = new DriveService(new BaseClientService.Initializer()
HttpClientInitializer = credential,
ApplicationName = "Drive API Sample",
File body = new File();
body.Title = "My document";
body.Description = "A test document";
body.MimeType = "text/plain";
byte[] byteArray = System.IO.File.ReadAllBytes("c:\\temp\\mygdriver.txt");
System.IO.MemoryStream stream = new System.IO.MemoryStream(byteArray);
FilesResource.InsertMediaUpload request = service.Files.Insert(body, stream, "text/plain");
request.Upload();
File file = request.ResponseBody;
Console.WriteLine("File id: " + file.Id);
Console.WriteLine("Press Enter to end this process.");
Console.ReadLine();
Kindly advise...

Hello,
For issues regarding google APIs, please post it to:
https://developers.google.com/maps/support/
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • CUA: One or more errors occurred while checking the status of Windows Firewall on the cluster nodes

    Cluster with 2 hosts 2012 R2
    Scheduled CAU fails with:
    CAU run {4EFE116C-AB49-456D-8EED-F7EDC764DA49} on cluster Cluster1 failed. Error Message:One or more errors occurred while checking the status of Windows Firewall on the cluster nodes. Review the errors for more information on how to resolve the problems.
    Error Code:-2146233088 Stack:   at MS.Internal.ClusterAwareUpdating.Util.<CheckFirewallsAsync>d__3a.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.ClusterAwareUpdating.Commands.InvokeCauRunCommand.<_ProcessCluster>d__78.MoveNext()
    If I run CAU "Analyze Readiness" ALL comes as PASS
    If I run CUA by hand on same hosts with NO change to the system (not even reboot) it finishes OK
    Anybody any ideas?
    Thanks
    Seb

    Hi,
    In some case if you disabled the connection in Windows firewall inbound of
     "Cluster aware updating" service it will can’t use the CAU.
    More information:
    Starting with Cluster-Aware Updating: Self-Updating
    http://blogs.technet.com/b/filecab/archive/2012/05/17/starting-with-cluster-aware-updating-self-updating.aspx
    What is Cluster Aware Updating in Windows Server 2012? (Part 1)
    http://blogs.technet.com/b/mspfe/archive/2013/02/06/what-is-cluster-aware-updating-in-windows-server-2012.aspx
    Cluster-Aware Updating Overview
    http://technet.microsoft.com/en-us/library/hh831694.aspx
    Hope this helps.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Form connot be imported because ones or more errors occured-infopath 2010

    when trying to import word documents (docx) in InfoPath I get "the form cannot be imported because one or more errors occurred" but there are no errors listed in the box.
    what should I be checking to resolve

    Hi,
    I understand that the reusable workflow doesn’t work properly now. Have you tried to remove the Update list item action to see whether the workflow can run without issue?
    If the workflow runs perfectly when the Update list item action is removed, then you need to check whether there are errors in the update action. Check whether the values have been changed.
    Thanks,
    Entan Ming
    Entan Ming
    TechNet Community Support

  • Some of the apps in your iTunes were not installed in the iPhone because one or more errors occurred.

    I have a Mac Air and an iPhone 5 and I have the latest iTunes installed and I was running Mountain Lion but, I upgraded to Mavericks thinking the upgrade will fix the problem but, I still have problems with my apps. For some reason it doesn't want to install back 119 apps and I tried to use the "Transfer Purchases" thing but it did not work. I will appreciate any useful help. Thank you.

    I'm going to answer myself this posting since I had a chat with one of the Apple support person and that person resolved my problem. Basically in iTunes I clicked on the iTunes Store and on the right side of the iTunes, it shows the "Quick Links", so I clicked there and I went to "Purchased" and I downloaded "All" my apps and that pretty much fixed my problem with the exception that, I had to manually download from my own phone some apps but once I had all my apps updated and my phone configured in the way I wanted, I performed another "sync" and no more error messages. I'm posting this in case someone else have the same problem.

  • HT5457 Upgraded iphone 4 to IOS 6.1 Can not restore apps. "Some of the applications in your iTunes library were not installed because one or more errors occurred" error message

    I made the mistake of upgrading my iPhone 4, a seemingly innocuous task if you follow the Apple commercials' rhetoric.
    Now I can not restore any of my apps and before I go to far, I am wondering if I wil be able to restore my purchased apps?
    Is there an easy fix, before I waste hours on the phone with Apple tech support?
    Why is it becoming so complicated to run a telephone?
    Thanks
    O

    I made the mistake of upgrading my iPhone 4, a seemingly innocuous task if you follow the Apple commercials' rhetoric.
    Now I can not restore any of my apps and before I go to far, I am wondering if I wil be able to restore my purchased apps?
    Is there an easy fix, before I waste hours on the phone with Apple tech support?
    Why is it becoming so complicated to run a telephone?
    Thanks
    O

  • HELP!!!  Message - (One or more applications are using the iTunes scripting interface. Are you sure you want to quit?)  How do I get this to stop?

    I bought a new Sony Vaio Laptop running Windows 8, 64bit, i7 processor.  Everytime I open iTunes and then close out, the following message occurs: (i-tunes message - One or more applications are using the iTunes scripting interface. Are you sure you want to quit?) Then it starts counting down from 20 seconds unless I just click on the (Quit) button.  How do I get this to stop?  Please be specific, I am challenged when it comes down to computers.
    Thank You

    This was extremely annoying for me, also.  I started uninstalling unneeded Sony applications to try to narrow down the problem.  It turned out not to be a Sony application... it is some functionality built into the bluetooth driver software package by Broadcom.  Uninstalling the bluetooth package (via the control panel) takes care of the problem.  Itunes also boots up way quicker.  But uninstalling it will remove features related to bluetooth and nfc.   For me, that isn't an issue, since I don't use them.  Since you said you're "computer challenged" I would probably just send an email to sony complaining about the problem.  They'll get in touch with Broadcom eventually (the manufacture of the drivers) and get the problem fixed.
    Side note: the Broadcom package is huge...  nearly 1GB in size.  Which is crazy.  I can't imagine what it does considering the size of it.  Entire operating systems can take up less storage.  Also, I have no idea how it starts an itunes plugin without placing it into the standard plugin directories.

  • How use Google Drive to do Backups with Time Machine?

    Hi everyone! I work in a company that give us a huge amount of space in google drive, bigger than my hard drive! The other day someone tried to break in. Luckily nothing happened but the computer and external hard drive were here! Since then I've been wondering some way to do an automatic back up with time machine using google drive account. No matter how long is take but at least i will be an online back up. I couldn't find anything useful so if there is some that could give a hint or just for to know if this is doable. Any suggestion, thoughts or ideas?
    Cheers!
    Cristian

    Try using a clone.
    Clone  - Carbon Copy Cloner          (Often recommended as it has more features than some others)
    Clone – Data Backup
    Clone – Deja Vu
    Clone  - SuperDuper
    Clone - Synk
    Clone Software – 6 Applications Tested

  • An impersonation error occurred using the security context of the current user. -- Report server is on remote server and file share folder is on local server

    I have deployed a report on the server (e.g. remoteserver\reports) from my local machine. I opened the report in browser in my local machine and created a new subscription with windows file share delivery option.
    But its giving an error "Failure writing file \\localserver\subscriptions\Report1.xls : An impersonation error occurred using the security context of the current user." Here "subscriptions"
    is the folder which I have created in my local machine.
    I followed the instructions found in the link "http://msdn.microsoft.com/en-us/library/ms157386.aspx"
    Please help to solve this issue.

    Hi,
    Thank you for your reply.
    I have followed the same process. The credentials which I have given are same as my PC. But I am getting the same error. Can you please clarify the statement "Service
    account that is using for file share subscription should have write access to shared folder."
    given in the above link?
    I am the one who created the folder and subscribing the report, so probably I have the full write permissions to the shared folder. What is the service account in this context?
    I think the problem is, I am deploying the report on the server and creating the shared folder in the local machine. I tried giving shared folder permissions to the user on the server. But my local machine is in local domain and I cant access the users on
    the remote server. Do I need to create a shared folder on the server? I am new to SSRS. Please help me.
    PS: I have assigned with all roles viz. Browser, Content Manager, Publisher, Report Builder etc. and My Role name (WEBSERVER\User)
    is different from my local user name (domain\username) in domain.

  • Using Google Drive

    I can not use google drive on my computer because of the OS. I have 10.5.8. What is an inexpensive (and easy?) upgrade that I can do to be able to use google drive. I don't necessarily need the newest system as I might be getting a new computer soon.

    Hello,
    First you need to research all the problems people are having with the higher OSX versions, & make sure you have a bootable clone of what you have just in case.
    then you must get 10.6 if they still have it, install it & update to 10.6.8 so you have the App Store to buy & download the huge 10.8 Installer.
    Snow Leopard/10.6.x Requirements...
    General requirements
       * Mac computer with an Intel processor
        * 1GB of memory (I say 4GB at least, more if you can afford it)
        * 5GB of available disk space (I say 30GB at least)
        * DVD drive for installation
        * Some features require a compatible Internet service provider; fees may apply.
        * Some features require Apple’s MobileMe service; fees and terms apply.
    Which apps work with Mac OS X 10.6?...
    http://snowleopard.wikidot.com/
    It's been pulled from the online store & Apple Stores, so you have to call Apple to buy it, last I heard.
    Call Apple Sales...in the US: 1-800-MY-APPLE. Or Support... 1-800-275-2273
    Other countries...
    http://support.apple.com/kb/HE57

  • One or more application are using Itunes scripting interface

    After downloading update on ITunes 10 on windows 7 it freezes.  Or something pops up and says one or more application are using itunes scripting interface quit. 
    I tried everything.  Help.

    well, you're the first one I''m seen reporting this, so that makes me think it is unique to your PC. So I doubt an updated iTunes version is going to "fix" this.
    The way to find things like this is by using MSCONFIG as explained in these directions. But it is tedious to find it, requires a lot of PC restarting. You said it's not a big deal, so you might not want to spend the time.
    http://docs.info.apple.com/article.html?artnum=302538

  • Items in the Itunes library were not copied because of one or two errors occurred. How to fix this problem?

    Items in the Itunes library were not copied because of one or two errors occurred. How to fix this problem?

    Hello mobyash,
    Have you tried converting each of these 8 tracks to a different file format and seeing if they will then sync to your iPod.  See this Apple support document for information and instructions on how to convert a song to a different format.
    iTunes: How to convert a song to a different file format
    B-rock

  • One or more errors were found while trying build the realse version

    While i am generating .ipa file i am getting another error mentioned below.
    One or more errors were found while trying build the realse version
    Packing error while generating .ipa file for iphone.

    This is a forum for Adobe Acrobat Froms not the Flash/Flex product.

  • Can't use my Comcast/Xfinity email on mozilla any more have to use google chrome to access it. I can log on through comcast/xfinity homepage but it will not let me read my email, just keeps redirecting me to inbox preview. Can this be corrected?

    Can't use my Comcast/Xfinity email on mozilla any more have to use google chrome to access it. I can log on through comcast/xfinity homepage but it will not let me read my email, just keeps redirecting me to inbox preview. I used to have no problem before firefox 7. Can this be corrected? Or should I discontinue using Firefox?

    Thank you! Thank You! Thank You!!! I have been arguing with Comcast for 6 months on this. They told me to uninstall and reinstall Firefox. Then I found this website and there was my solution. It worked. It was annoying that they told me to use internet explorer. The worst part is I pay them monthly. Well, as soon as my contract is up, I am done with Comcast. They still haven't figured out why my favorite stations aren't coming in. Funny thing is my roommate has Direct t.v. with no problems. At half the price. See ya Comcast. I am done paying for shabby over priced service. Thank you Firefox. I can't believe I pay for crappy service and this is free.

  • How to use Google API for Visual Studio Application using Google Drive

    I am creating an VB 2010 Form that will collect data and then automate sharing to select individuals. Right now I am storing the data in the Google Drive folder on the Desktop but some people that may be using this application may not have Google Drive downloaded
    on their desktop so I would like to know if there is another way to add the data files (Excel files) to Google Drive. I would also like to have my application automatically share the files with select individuals and possibly publish onto Google+ or at
    least create a notification on Google+ that a new file has been added to the Drive. Thanks in advance for ANY help that anyone can offer!

    Hello,
    Thank you for your post.
    I am afraid that the issue is out of support range of VS General Question forum which mainly discusses
    the usage of Visual Studio IDE such as WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
    and Visual Studio Editor.
    Because you use Google Drive and Google API which are third-party, I suggest consult on its support forum/community provided by its publisher.
    IN addition, about Visual Basic programming, please consult on Visual Basic forum:
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vbgeneral for better response.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Adf mobile - Deployment failed due to one or more errors returned by 'osascript'

    I had the mac jdeveoper deploying a mobile app in ios emulator file running fine.
    I had to update the xcode to xcode5 to get the certificate - now the deployment to emulator won't work.
    These are the error messages
    [02:34:41 PM] Command-line execution succeeded.
    [02:34:41 PM] Command-line executed: [osascript, -e, tell application "iPhone Simulator" to activate]
    [02:34:41 PM] Command-line execution failed (Return code: 1)
    [02:34:41 PM] Deployment cancelled.
    [02:34:41 PM] ----  Deployment incomplete  ----.
    [02:34:41 PM] Failed deploying to the iOS simulator.
    [02:34:41 PM] Deployment failed due to one or more errors returned by 'osascript'.  The following is a summary of the returned error(s):
    Command-line execution failed (Return code: 1)

    I deleted xcode 5 and installed xcode 4.6.3. Simulator works ok for 6.1 simulator target version.
    In jdeveloper ios option only 6.1 shows up for simulator target version?
    How do I get the 7 to show up there please?
    If simulator will not show up - can I still deploy / test it in iphone with ios7?

Maybe you are looking for