Kralizek / Assembla.Connector

A .NET Standard wrapper for Assembla REST API.
MIT License
3 stars 2 forks source link

Cannot convert from 'System.Net.Http.HttpClient' to 'Kralizek.Assembla.AssemblaAuthenticator' #4

Open its-dtran opened 5 years ago

its-dtran commented 5 years ago

Ran 'list-your-spaces.linq' in LINQPad5 with my credentials and got this error: "CS1503 Argument 1: cannot convert from 'System.Net.Http.HttpClient' to 'Kralizek.Assembla.AssemblaAuthenticator'"

I tried searching for a solution without any success. Any ideas on how to fix this?

Best Regards, David

Kralizek commented 5 years ago

Hi @its-dtran Sorry for the late reply, may I ask you to attach a Minimal, Complete, and Verifiable example of the full scenario, so I can better see it from end to end?

its-dtran commented 5 years ago

Hi @Kralizek I am using your sample file and I attached it here list-your-spaces.linq.txt. It is the same as https://raw.githubusercontent.com/Kralizek/Assembla.Connector/master/samples/LinqPad/list-your-spaces.linq

Here are the steps to reproduce:

  1. Rename the above script file and remove the .txt extension
  2. Open script with LINQPad 5 (v5.36.03 - https://www.linqpad.net/Download.aspx)
  3. Download/install the dependencies if prompted
  4. Run the script in LINQPad
  5. Observe error: "CS1503 Argument 1: cannot convert from 'System.Net.Http.HttpClient' to 'Kralizek.Assembla.AssemblaAuthenticator'"

Note: The error is the same whether I change the hard-coded credential or not.

Hopefully, this is enough for you. I apologize if it not a good MCVE.

Best Regards, David

Kralizek commented 5 years ago

Ok. I found the issue. The linqpad samples were written with an older version of the library that accepted the httpclient directly.

Now you have to pass an AssemblaAuthenticator like the UserAuthenticator in the sibling package.

If you want to attempt a pull request, I'd be grateful!