I've read that in order to disable caching while using get and post methods in HttpClient
, I need to use a WebRequestHandler
as my HttpClient
's HttpClientHandler
, and change its cache policy. However, WebRequestHandler
is not within System.Net.Http.dll, but rather in System.Net.Http.WebRequest.dll, so I tried to add the .dll to the project as a reference. I got an error message:
Microsoft Visual Studio
A reference to a higher version or incompatible assembly cannot be added to the project.
Again, after a little search, I concluded that the .dll file was blocked because it was downloaded from another source. To unblock it, I went on trying the solution here. However, it didn't work either and I'm still getting the same error when I try to add the .dll file as a reference.
All I want to do is disable caching using my HttpClient, am I doing anything wrong here? I'm open to any type of advice or help.
My system is Windows 8.1 and I'm using Visual Studio 2013. The project I'm working on is a Windows Phone 8 application. The directory of .dll I'm trying to reference is "C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Net.Http.WebRequest.dll". Thank you in advance.