c# - Nuget Error: Failed to add reference to System.Net.Http -


i getting error:

"could not load file or assembly 'system.net.http.primitives, version=4.2.22.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a' or 1 of dependencies. system cannot find file specified.":"system.net.http.primitives, version=4.2.22.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a"}

running following code:

        base.initialize(name, config);         _emailaddress = settings.emailaddress;         string clientsecret = settings.clientsecret;         string clientid = settings.clientid;         task<usercredential> tcredential;         clientsecrets clientsecrets = new clientsecrets {clientid = clientid, clientsecret = clientsecret};         tcredential = googlewebauthorizationbroker.authorizeasync(             clientsecrets,             scopes,             "user",             cancellationtoken.none);         usercredential credential;         try         {             credential = tcredential.result;         }         catch (exception ex)         {             throw;         }         _service = new gmailservice(new baseclientservice.initializer()         {             httpclientinitializer = credential,             applicationname = "draft sender", //applicationname,         }); 

any ideas on how resolve error?

i tried updating install of http client libraries nuget according this answer, failed install error: failed add reference system.net.http, please make sure in global assembly cache. don't know global assembly cache is, or how make sure in there. there solution problem?

try updating nuget package manager going tools -> extensions , updates -> updates -> nuget package manager -> update.

and uninstall package , install again.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -