Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I use RestClient.ExecuteTaskAsync on .Net 3.5 when using TaskParallelLibrary and AsyncBridge ? #718

Closed
who opened this issue Jul 16, 2015 · 1 comment

Comments

@who
Copy link

who commented Jul 16, 2015

The NuGet packages TaskParallelLibrary and AsyncBridge.Net35 bring Task, await, and general support for async to .Net 3.5.

However, when I include these dependencies alongside RestSharp and attempt compiling to a .Net 3.5 target, the preprocessor directives defined in RestClient.Async.cs prevent me from using RestClient.ExecuteTaskAsync.

If I force the inclusion of the RestSharp .Net 4.0 DLL into my .Net 3.5 context, then I get this error when compiling (using mono):

error CS1684: Reference to type `System.Threading.Tasks.Task`1<RestSharp.IRestResponse<T>>' claims it is defined assembly `mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089', but it could not be found

Getting to the point
So, my question is, can I use the async features of RestSharp in .Net 3.5 by shimming in the NuGet packages above? Has anyone gotten this to work?

@hallem
Copy link
Member

hallem commented Jul 17, 2015

The short answer is no, the Async support in RestSharp requires .Net 4.0+

@hallem hallem closed this as completed Jul 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants