You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Emitted refs wrong for 4.5.1 System.Net.Http.Formatting.dll #68
As per this overviewportable-wp8+netcore45+net45+wp81+wpa81 is related to PCLs. So the second When should be generated with another condition and the third one should not be generated at all. As soon as the folder below lib starts with portable we need to translate the strings separated by + into a framework profile (see link). Sadly the one used here is not documented and Google results very sparse.
@agross@forki Obv I dont directly use the class; it's loaded by something indirect. Right now, it's just raw WebApi.AspNet
If you want I can spider it's dependencies, but looking at @agross ' detailed research elsewhere I doubt I'm going to be efficient locating the required inputs!
I didnt have an explicit reference to System.Net.Http. Not sure how that came about, but me deleting it manually is a def possibility.
When one runs an install in that state, Paket puts in a reference to one in a packages\Microsoft.Net.Http\lib\net40 dir as a default.
This triggers the warn:
C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
The inconsistency is that most of the stuff is being (correctly) picked up from a net45 folder, inc 2 dlls that are dependent on System.Net.Http.dll.
So, to repro the problem, either
start with 4.0 and add Microsoft.Net.Http package
install will add the Paket stuff
switch to 4.5/4.5.1 will confuse matters
start with 4.5/4.5.1 (which will already include the System.Net.Http simple framework reference
And to fix the problem, the Paket-induced ref to the one in packages\Microsoft.Net.Http\lib\net40should happen under net40 but not under 45 or 451
@forki you pasted the same screenshot twice but I've got the problem burned into my retina....
The problem here is that
in 4.0, install needs to both reference its own thing and remove any 4.5+-supplied reference pathed reference
in 4.5+ install needs to ensure that a normal reference is present and/or allow it to be present
I'd be surprised if NuGet handled this correctly (i.e. I'd say the wizards can gen a 4.0 or a 4.5 app but just package install/reinstall is not going to allow you to compile and run correctly without intevention re adding/removing references).
I think the disconnect here is that NuGet and .nupkgs assume you derive a platform at the point of installation and then one 'set' wins per area and can't really see how Paket can handle most things correctly if it doesn't work that way too (I realize of course that the correct in-order-of-folder insertion that Paket manages is yet another thing in play to make it a pretty hard problem).
But, back to the problem: one critical outcome Paket needs to deliver is to be able to make idempotent changes to the proj files.
I don't think it makes any sense to have Paket start understanding the relationship between builtin System.Net.Http vs Nuget ones prior to 4.5 iff it can be avoided.
For now, I think if Paket can make a project level determination of the platform and/or when flattening that down per file generate a leg of a <Choose> that has no file, it'll be fine. The thing that's not intrinisically dealt with then is the need to add/remove the ref to the intrinsic one as one switches to/from 4.5 to 4.0. But that can be a separate issue and is pretty corner casey I say!
I'm pretty sure the wizard gave me and/or I added:
<Reference Include="System.Net.Http" />
BUT it's not there - I'm guessing it's due to doing an install --hard (other explanation is I deleted the ref in reproing?)
If I remove the bindingRedirect, I get:
Could not load file or assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)<
For reproing, I'm not doing anything interesting - I have a pretty vanilla WebApi app (no MVC) from the F# MVC 5 template.
The wiz and/or me via Sln Assembly Refs can add:
<Reference Include="System.Net.Http" />
The Paket bits don't case a problem - the Paket one is ignored and doesnt go to outdir
But the redirect is needed.
I should clarify the bit that actually triggers the error is hyperlinkr, which is built against WebApi 1 (vs 2 in 4.5 and 2.2 on nuget latest)
The line of code is:
open Ploeh.Hyprlinkr
...
let link2 = RouteLinker(this.Request).GetUri( fun (x: ProductsController) -> x.Get id)
If you don't ref System.Net.Http, the this.Request bit won't compile.
NB For me the actual repro of the downstream problem is a red herring though - the fact there's a compiler warning is enough (even though that's because hyprlinkr wants a different version). The bottom line is that the compilation needs to be against the new dll, not the net40 one.
In summary, Paket is behaving pretty predictably as previously described.
It's 'Just' a matter of figuring out whether the NuGet package and/or tooling perhaps encodes the fact that for target FW 4.5/4.5.1 the standard reference assembly should be used instead (I think one can specify Non-NuGet FW Assembly refs per target fw?). Either way a net40 should only be used for 4.5/4.5.1 iff there are no 4.5 / 4.5.1 libs at all (and same rule for sources etc.)
Activity
forki commentedon Sep 9, 2014
It creates the following:
that's strange. .NET 4.5 is in two path. .NET 4.5.1 should be covered by the last When condition.
/cc @agross
agross commentedon Sep 9, 2014
As per this overview
portable-wp8+netcore45+net45+wp81+wpa81is related to PCLs. So the secondWhenshould be generated with another condition and the third one should not be generated at all. As soon as the folder belowlibstarts withportablewe need to translate the strings separated by+into a framework profile (see link). Sadly the one used here is not documented and Google results very sparse.agross commentedon Sep 9, 2014
I created a PCL project to check what's set for it:
Profile259==lib/portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1bartelink commentedon Sep 9, 2014
@forki @agross The problem is that the app was not happy with the PCL one at runtime, i.e. the first one needs to succeed.
Didn't analyze why yet.
Looking...
bartelink commentedon Sep 9, 2014
The one that's:
Fails because it has stuff missing, triggering YSOD:
And you can guess the rest:
bartelink commentedon Sep 9, 2014
@agross @forki Obv I dont directly use the class; it's loaded by something indirect. Right now, it's just raw WebApi.AspNet
If you want I can spider it's dependencies, but looking at @agross ' detailed research elsewhere I doubt I'm going to be efficient locating the required inputs!
agross commentedon Sep 9, 2014
That's right, Paket should get you the first one and have
Conditions for the portable libs that's excluding them for your 4.5.1 project.forki commentedon Sep 16, 2014
can you please test if this is fixed in 0.2.0-alpha009
bartelink commentedon Sep 16, 2014
Will do; Hopefully tomorrow...
bartelink commentedon Sep 17, 2014
@forki Looking great in
0.2.0-alpha011- Thanks!bartelink commentedon Sep 17, 2014
One more thing which I'll log here for triage...
I didnt have an explicit reference to
System.Net.Http. Not sure how that came about, but me deleting it manually is a def possibility.When one runs an
installin that state, Paket puts in a reference to one in apackages\Microsoft.Net.Http\lib\net40dir as a default.This triggers the warn:
The inconsistency is that most of the stuff is being (correctly) picked up from a
net45folder, inc 2 dlls that are dependent onSystem.Net.Http.dll.So, to repro the problem, either
Microsoft.Net.HttppackageSystem.Net.Httpsimple framework referenceAnd to fix the problem, the Paket-induced ref to the one in
packages\Microsoft.Net.Http\lib\net40should happen undernet40but not under45or451forki commentedon Sep 19, 2014
wow this one is really fucked up.
We generate:
because we find System.Net.Http.dll in net40.
It doesn't exist for net45. BUT the net45 folder exists.
anybody an idea for a clever rule?
bartelink commentedon Sep 20, 2014
@forki you pasted the same screenshot twice but I've got the problem burned into my retina....
The problem here is that
I'd be surprised if NuGet handled this correctly (i.e. I'd say the wizards can gen a 4.0 or a 4.5 app but just package install/reinstall is not going to allow you to compile and run correctly without intevention re adding/removing references).
I think the disconnect here is that NuGet and
.nupkgsassume you derive a platform at the point of installation and then one 'set' wins per area and can't really see how Paket can handle most things correctly if it doesn't work that way too (I realize of course that the correct in-order-of-folder insertion that Paket manages is yet another thing in play to make it a pretty hard problem).This same disconnect manifests itself in the problem in the source installation where redundant folders remain present.
But, back to the problem: one critical outcome Paket needs to deliver is to be able to make idempotent changes to the proj files.
I don't think it makes any sense to have Paket start understanding the relationship between builtin
System.Net.Httpvs Nuget ones prior to 4.5 iff it can be avoided.For now, I think if Paket can make a project level determination of the platform and/or when flattening that down per file generate a leg of a
<Choose>that has no file, it'll be fine. The thing that's not intrinisically dealt with then is the need to add/remove the ref to the intrinsic one as one switches to/from 4.5 to 4.0. But that can be a separate issue and is pretty corner casey I say!forki commentedon Sep 20, 2014
could you please create a working references XML snippet and copy it here? I'm a bit lost.
bartelink commentedon Sep 20, 2014
I'm even more lost now that I've examined things :)
Web.config has:
Paket gave me:
I'm pretty sure the wizard gave me and/or I added:
BUT it's not there - I'm guessing it's due to doing an
install --hard(other explanation is I deleted the ref in reproing?)If I remove the
bindingRedirect, I get:For reproing, I'm not doing anything interesting - I have a pretty vanilla WebApi app (no MVC) from the F# MVC 5 template.
The wiz and/or me via Sln Assembly Refs can add:
The Paket bits don't case a problem - the Paket one is ignored and doesnt go to outdir
But the redirect is needed.
I should clarify the bit that actually triggers the error is hyperlinkr, which is built against WebApi 1 (vs 2 in 4.5 and 2.2 on nuget latest)
The line of code is:
...
If you don't ref
System.Net.Http, thethis.Requestbit won't compile.NB For me the actual repro of the downstream problem is a red herring though - the fact there's a compiler warning is enough (even though that's because
hyprlinkrwants a different version). The bottom line is that the compilation needs to be against the new dll, not thenet40one.bartelink commentedon Sep 20, 2014
Hang on, VS changed the Paket genned bit to:
When I hit delete on the ref (OK, that makes sense whenI think about it).
Then I added it back via add references.
Now
paket install(built yesterday) removes all reference to the net40 one (which would be wrong if I switched back to 4.0 but works for me).If I delete and do a
paket install, leaving at 4.5.1, Paket puts in:In summary, Paket is behaving pretty predictably as previously described.
It's 'Just' a matter of figuring out whether the NuGet package and/or tooling perhaps encodes the fact that for target FW 4.5/4.5.1 the standard reference assembly should be used instead (I think one can specify Non-NuGet FW Assembly refs per target fw?). Either way a
net40should only be used for 4.5/4.5.1 iff there are no 4.5 / 4.5.1 libs at all (and same rule for sources etc.)bartelink commentedon Sep 20, 2014
NPE (hadnt tried it - its great!) confirms that there are conditional framework dependency items in the package
Then the remaining bit is to only install the
libcontent for a single target framework.Want me to close this and log specific issues (happy for anyone else to do it either)?
forki commentedon Sep 21, 2014
Yes please close this monster thread and create a new one with simple repro steps
bartelink commentedon Sep 21, 2014
@forki OK, might not get time till a good bit later but will do
bartelink commentedon Sep 22, 2014
Split into: