Noha Basiony
Noha Basiony

Reputation: 11

Ambiguous use of System.Net.Http.HttpClientExtensions

Could you please help me to know why this error appear ??

error:Severity Code Description Project File Line Suppression State Error CS0121 The call is ambiguous between the following methods or properties: 'System.Net.Http.HttpClientExtensions.SetBearerToken(System.Net.Http.HttpClient, string)' and 'System.Net.Http.HttpClientExtensions.SetBearerToken(System.Net.Http.HttpClient, string)' ImportTrustsApp C:\@Noha Basiony\NowInfinity Web\web\smsf.web\ImportTrustsApp\Program.cs 45 Active

enter image description here

Upvotes: 1

Views: 3408

Answers (1)

VIGNESH ARUNACHALAM
VIGNESH ARUNACHALAM

Reputation: 674

It appears that older versions of System.Net.Http.HttpClientExtensions assemblies have been cached and now they conflict with the newly installed assemblies. Please follow these steps, which should help you overcome the problem:

  1. Delete your current System.Net.Http.HttpClientExtensions reference.
  2. Add new System.Net.Http.HttpClientExtensions reference.
  3. Close Visual Studio .
  4. Clear the project's Bin and Obj folders.
  5. Rebuild your application.

Upvotes: 2

Related Questions