-
-
Notifications
You must be signed in to change notification settings - Fork 391
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
Flurl switches from PCL reference to .NET Standard reference after upgrading to .NET 4.6.2 #176
Comments
Try completely uninstalling both Flurl(.Signed) and Flurl.Http(.Signed) and re-install just Http. If that doesn't work, try this. Let me know your findings. A couple things are in the works that may address this as well:
|
Unfortunately, neither worked. I tried removing Flurl.Http.Signed from the project.json where it is referenced, ran nuget restore, added the reference back to the project.json, and ran nuget restore again (note: I never referenced Flurl.Signed explicitly -- it was always implicitly referenced through Flurl.Http.Signed). I got the same MissingMethodException in my unit tests. I also tried adding a reference to Microsoft.Net.Http 2.2.29. Same MissingMethodExceptions. |
@mwelsh1118 please give me a link to the repo which reproduces this problem. |
Here you go: The real problem exists in a large proprietary application, but I replicated the symptom in the above repo. I'm referencing Flurl via a project.json reference, but I saw the same problem if I switch to PackageReference tags in the csproj file. This repro uses VS 2017, but the problem exists with NuGet 3.4 & VS 2015 as well. |
@mwelsh1118 I dont have any problems with your repo. I see packages and no build errors. I have vs2017 sp1.
|
@kroniak Please check out the readme for the repo. It builds fine, but it pulls the netstandard version of Flurl.dll which causes various problems. |
@mwelsh1118 I dont know what to do in this case. NET STD 1.4 include NET462 target. Nuget installer installs this version correctly. I can add a NET462 target and export dlls to package, but we can't do that with all targets 452, 461, 462, 470. |
@kroniak Flurl.Http has a net45 folder (which gets used when targeting 4.5+) but Flurl itself does not. I think doing the same for Flurl would fix the problem. |
@mwelsh1118 It does not fix this problem. Nuget will installs NETSTD dll for net 451+. NET45 dll uses only for net 45 which not supported by NETSTD. |
@kroniak That's not what I'm seeing, at least with Flurl.Http. The project.lock.json file points to lib/net45/Flurl.Http.dll when I'm targeting .NET 4.6.2. |
@mwelsh1118 I will look this case at this week. |
I had the same issue. I created a fresh new .Net 4.6.2 library project, installed Flurl from nuget, created another test project (same 4.6.2) and got this error while running some test. I downgraded the library project to .Net 4.5 and worked ok. With .Net 4.6.2 it installed lots of dependant packages (System.*) |
I worked around it for the time being by creating my own NuGet packages with a net45 folder that mirrored the portable one. That did indeed fix the problem. |
@mwelsh1118 @adrianiftode I am working on this problem now on fix-176. |
@kroniak With my last 2 commits I am able to build in VS 2017 and CLI and all tests are passing. However, AppVeyor is not happy. I thought that might be the case with my last commit. Possibly related issues: Might help but I'm not sure: |
This is looking good, we'll try to get a prerelease out in the next couple days. I want to be sure and test what @adrianiftode saw (I have noticed this too): Currently when Flurl.Http is pulled into .NET 4.6 projects, it pulls with it about a dozen additional libraries it shouldn't need, presumably because it's using the PCL version. The PackageTesters confirm this. When the prerelease is live, let's just remember to clear all NuGet packages from PackageTester.NET45 and PackageTester.NET461, install the prerelease, and confirm that the only installed packages are Flurl, Flurl.Http, and Newtonsoft.Json. |
@tmenier prereleasing versions are avalible in
Nuget pulls additional packages from NETSTD dependicies for net4.6, not PCL, I see. |
@kroniak I removed all nuget packages from the NET45 and NET461 package testers, then reinstalled Flurl.Http 1.2 (from appveyor feed) in both. That worked perfectly - both contain just the 3 packages. However, the NET461 version will not build. It's saying it needs a reference to System.Net.Http 4.0. If I add that to the project it will probably work, but I shouldn't need to do that, right? I also noticed the NET461 version is pointed at net40/Flurl.dll and net45/Flurl.Http.dll. Shouldn't it be pointing to the netstandard1.3 versions of those? I can commit and push this if you want to take a look. |
3 scenario:
But in case 2, system reference was added fine. |
When I installed in a .NET 4.6.x project (new or existing), |
@tmenier As for me, that is more correct than target |
Since Are you still investigating anything here or would you say this is ready for release? |
@tmenier No, I am not. I want to hear a feedback from issues creators before a release. |
Answered already, and by Oren Novotny, who I'd say is an authority on the topic:
I'd rather that the consumer got the latest & greatest bits available for the platform they're targeting, but maybe it doesn't matter. We might want to discuss this more for the next major versions. |
Sounds good. I'd still like to publish a |
@mwelsh1118 @adrianiftode Fix for this in pre-release. Please test and report your findings.
|
Thx all, full release is live so we can finally put this one to bed. |
I have a large application targeting .NET 4.5.2 that is referencing Flurl.Http.Signed (and therefore Flurl.Signed) via NuGet.
When I change the target to .NET 4.6.2, I run into MissingMethodExceptions around System.Net.Http. It seems Flurl is expecting System.Net.Http 4.1. The rest of the application is expecting System.Net.Http 4.0.
In the .NET 4.5.2 case, I end up with the PCL version of Flurl (lib\portable40-net40+sl5...). In the 4.6.2 case, I end up with the .NET Standard version of Flurl (lib\netstandard1.4).
I noticed Flurl.Http.Signed has lib\net45, which seems like what I really want in either case, but Flurl.Signed does not.
Is there a way to make Flurl work while targeting .NET 4.6.2?
The text was updated successfully, but these errors were encountered: