richardschneider / net-ipfs-http-client

InterPlanetary File System client for .Net (C#, VB, F# ...)
MIT License
158 stars 52 forks source link

System.Net.Http #15

Closed hitchhiker closed 6 years ago

hitchhiker commented 6 years ago

My projects are .NET standard 2, with WIN UI WPF, and other Windows only projects in 4.7.1

There's been a lot of trouble with the System.Net.Http package and others after the latest .NET Standard 2 / VS 2017 update, unfortunately IPFS is requiring it. Previously i've (and many others) had to go through a lengthy process to remove all pre-4.7.1 packages from our projects (things like System.Runtime which now have a 4.7.1 facade).

However when installing Ipfs.Api this is all undone:

NETFramework,Version=v4.7.1:

Retrieving package 'System.IO 4.3.0' from 'nuget.org'. Retrieving package 'System.Net.Http 4.3.3' from 'nuget.org'. Retrieving package 'System.Runtime 4.3.0' from 'nuget.org'. Retrieving package 'System.Security.Cryptography.Algorithms 4.3.0' from 'nuget.org'. Retrieving package 'System.Security.Cryptography.Encoding 4.3.0' from 'nuget.org'. Retrieving package 'System.Security.Cryptography.Primitives 4.3.0' from 'nuget.org'. Retrieving package 'System.Security.Cryptography.X509Certificates 4.3.0' from 'nuget.org'.

These packages had to be removed earlier, they have facades now, and the nuget package seems to seriously confuse VS (and me).


What can be done?

richardschneider commented 6 years ago

I've never used WinUI. I'll do some research and get back to you.

hitchhiker commented 6 years ago

Hi @richardschneider, thanks.. I meant the "U.I. projects for Windows" WPF in this case -> (not WinUI), sorry for the confusion.

Basically I've pulled the project and removed the reference to system.net.http, it compiles to .net standard with no errors. As far as I can tell, the reference is now unnecessary - i've not tested the compiled dll yet, but it should work via the 4.7.1 facades without needing the reference explicitly added in the project's references.

richardschneider commented 6 years ago

Great work. Just send me a PR and I'll do all the testing.

hitchhiker commented 6 years ago

Done: https://github.com/richardschneider/net-ipfs-api/pull/16

I'm absolutely no expert with this new VS / Standard 2 package malarky, I simply conditioned the System.Net.Http reference to only include during net45/standard14

richardschneider commented 6 years ago

I agree VS/Standard 2 is strange. Thanks for your help.

You changes are in release v0.11.0

hitchhiker commented 6 years ago

Hi @richardschneider - In actual fact, what I needed to do was create a new profile for .net 4.7.1 -> to allow those frameworks to also skip System.Net.Http.

I'll issue a PR.