pmorelli92/SoapHttpClient

Not Compatible with .Net Standard 2.0

Closed this issue · 6 comments

pha3z commented

:(

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 commented

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.

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 commented

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?

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 commented

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.

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 :)