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

Not Compatible with .Net Standard 2.0 #15

Closed
pha3z opened this issue Sep 5, 2019 · 6 comments
Closed

Not Compatible with .Net Standard 2.0 #15

pha3z opened this issue Sep 5, 2019 · 6 comments

Comments

@pha3z
Copy link

pha3z commented Sep 5, 2019

:(

I was hoping to use this in a very large project, but I need to use it in a .Net Standard 2.0 library.

Since it uses HttpClientFactory, it's not compatible with .Net Standard 2.0.

Is there an older working version that is Standard compatible? Or perhaps there is a workaround, such as an alternative constructor that takes an HttpClient instead of factory?

Thanks,
James

@pha3z
Copy link
Author

pha3z commented Sep 5, 2019

I'll add this:

According to the changelog, the only change listed on 3.0 was switching to the factory.. and that's all that was done.

It should always be preferred to target the latest .Net Standard instead of the current flavor of Core when building libraries.

@pmorelli92
Copy link
Owner

Hello @pha3z, the library targets net standard 2.0, it does not target net core api as you can see
here

I don't know the specifics of your project, on what error is giving you, but in any case you can try with 2.2.1 that uses HttpClient instead of the HttpFactory :)

@pha3z
Copy link
Author

pha3z commented Sep 6, 2019

I am perplexed. HttpClientFactory is not part of the .Net Standard 2.0 documentation:
Click here to see Microsoft .Net Standard 2 Documentation search results

And if I try to use HttpClientFactory in a .Net Standard 2.0 library, it has no idea what I'm talking about. There's no using prompt offered to suggest a namespace.

How did you conclude that HttpClientFactory is part of the .Net Standard 2.0?

@pmorelli92
Copy link
Owner

Hi @pha3z, I am not arguing that it is part of the net standard, and that is why you can clearly see that it depends on the Microsoft Http Extensions lib. All I am saying is that the library is targeting .net standard :)
It is obvious that if it was part of the net standard, then it will no longer need another dependency, right?

That being said, it should not conflict if you reference the library from a project that uses .net standard 2.0. So your argument about being not compatible to net standard 2.0 is not true.

@pha3z
Copy link
Author

pha3z commented Sep 6, 2019

OK I did not understand that it there is an Extensions dependency. I didn't see any dependencies mentioned on the home readme page, and I thought it was a fully self-contained library.

It makes sense now.

@pmorelli92
Copy link
Owner

Dependencies are stated on the nuget package as any other dotnet library has.

By the way, here I created an example so you can see how to use it from .net standard lib.

Glad I could help :)

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