Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

Frans C.'s avatar
Frans C.
New member | Level 1
9 years ago

Api v2 .Net4.0 no Task.Run method

I got a new app working from home on .Net4.5, using your example code:

var task = Task.Run((Func<Task>)MainWindow.GetCurrentAccount);
task.Wait();

However, at work they use .Net4.0, so I targeted that version.
Now the compiler tells me:

Error    'System.Threading.Tasks.Task' does not contain a definition for 'Run'

How should I do calls now?

Best regards, Frans

2 Replies

  • Hi Frans,

    async Task library is shipped with .Net 4.5 which is not available for .Net 4.0. You can use TaskEx.Run instead which is part of the BCL library that Dropbox SDK depends on.

  • Frans C.'s avatar
    Frans C.
    New member | Level 1
    9 years ago

    Thanks for your quick response Qiming, I will try that.

    Best regards, Frans

About Dropbox API Support and Feedback

Node avatar for Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!