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
Paket should automatically add / update existing / delete old binding redirects to all .config (both app and web) files it locates after a restore or update operation.
To stop getting runtime errors? Let's say you have package A that has a dependency on package B v1.0. You get the latest version of Package B, v1.1. You run your application, it goes pop because package A is looking for v1.0 of Package B. You need to manually put a binding redirect in your configuration file to redirect the request for v1.0 to accept v1.1 instead.
I have to admit I'm not very fond of adding redirects automatically. NuGet does that as well, and each time I see a config full of redirects it scares the crap out of me.
I just converted a project from nuget to Paket and got rid of more than half of my redirects.
Alex
Alexander Groß
Tiny phone, tiny mail
On Sun, Oct 12, 2014 at 1:13 PM, Isaac Abraham [email protected]
wrote:
To stop getting runtime errors? Let's say you have package A that has a dependency on package B v1.0. You get the latest version of Package B, v1.1. You run your application, it goes pop because package A is looking for v1.0 of Package B. You need to manually put a binding redirect in your configuration file to redirect the request for v1.0 to accept v1.1 instead.
Reply to this email directly or view it on GitHub: #245 (comment)
The real problem is that MSBuild (and to a lesser exent) .NET in general has no notion of package dependency - the only item that you can reference is the assembly.
So whilst I agree with you re: binding redirects looking scary - I think that they solve more problems than they cause. But again, IMHO.
@isaacabraham Fair enough. Binding redirects indeed solve problems. NTL, the user should have chance (and responsibility) to know and deal with such a "squiggling reference". I think it's a good thing if paket tries to be transparent on reference/contraint issues.
I think paket should know about diverging version constraints towards package B. I want to reiterate this using your example, just to make sure I understood correctly.
You have dependency A (>0)
You have dependency B (>1.0)
You have transitive/indirect dependency A -> B (1.0).
An update gets you B (1.1), whilst A keeps stable and requires (1.0). An assembly redirect is needed to overcome this situation.
Presuming that the update operation is done using paket update, we could detect this situation and give the user feedback on it. I propose that neither update nor restore operations should automatically add/remove binding redirects but rather let the user know about it with warnings.
For the sake of convenience, we could think about explicit opt-in within a --force operation (which I wouldn't like at all). An alternative option would be to introduce a command, i.e. paket patch --inter-reference-constraints.
Yep, I think we should make it explicit. Maybe not only the patching but another command to check whether binding redirects are required in the first place.
@isaacabraham Fair enough. Binding redirects indeed solve problems. NTL, the user should have chance (and responsibility) to know and deal with such a "squiggling reference". I think it's a good thing if paket tries to be transparent on reference/contraint issues.
I think paket should know about diverging version constraints towards package B. I want to reiterate this using your example, just to make sure I understood correctly.
You have dependency A (>0)
You have dependency B (>1.0)
You have transitive/indirect dependency A -> B (1.0).
An update gets you B (1.1), whilst A keeps stable and requires (1.0). An assembly redirect is needed to overcome this situation.
Presuming that the update operation is done using paket update, we could detect this situation and give the user feedback on it. I propose that neither update nor restore operations should automatically add/remove binding redirects but rather let the user know about it with warnings.
For the sake of convenience, we could think about explicit opt-in within a --force operation (which I wouldn't like at all). An alternative option would be to introduce a command, i.e. paket patch --inter-reference-constraints. @agross@forki What's your opinion on that?
What's the best place for me to integrate the code in? I have something that will take in a config file and a binding redirection and apply it to the config file (if the redirection doesn't exist, it creates it, otherwise it overwrites the existing one with the new one).
I sounds very cool. We need to discuss the scenario. When do we want this
to happen.
On Oct 17, 2014 11:32 PM, "Isaac Abraham" [email protected] wrote:
What's the best place for me to integrate the code in? I have something
that will take in a config file and a binding redirection and apply it to
the config file (if the redirection doesn't exist, it creates it, otherwise
it overwrites the existing one with the new one).
—
Reply to this email directly or view it on GitHub #245 (comment).
Activity
ilkerde commentedon Oct 12, 2014
Why?
isaacabraham commentedon Oct 12, 2014
To stop getting runtime errors? Let's say you have package A that has a dependency on package B v1.0. You get the latest version of Package B, v1.1. You run your application, it goes pop because package A is looking for v1.0 of Package B. You need to manually put a binding redirect in your configuration file to redirect the request for v1.0 to accept v1.1 instead.
Or am I missing something here.
agross commentedon Oct 12, 2014
I have to admit I'm not very fond of adding redirects automatically. NuGet does that as well, and each time I see a config full of redirects it scares the crap out of me.
I just converted a project from nuget to Paket and got rid of more than half of my redirects.
Alex
Alexander Groß
Tiny phone, tiny mail
On Sun, Oct 12, 2014 at 1:13 PM, Isaac Abraham [email protected]
wrote:
isaacabraham commentedon Oct 12, 2014
We should at least make this optional. I've already seen both projects that I've converted from nuget to paket go pop for exactly this reason.
isaacabraham commentedon Oct 12, 2014
The real problem is that MSBuild (and to a lesser exent) .NET in general has no notion of package dependency - the only item that you can reference is the assembly.
So whilst I agree with you re: binding redirects looking scary - I think that they solve more problems than they cause. But again, IMHO.
ilkerde commentedon Oct 12, 2014
@isaacabraham Fair enough. Binding redirects indeed solve problems. NTL, the user should have chance (and responsibility) to know and deal with such a "squiggling reference". I think it's a good thing if paket tries to be transparent on reference/contraint issues.
I think paket should know about diverging version constraints towards package B. I want to reiterate this using your example, just to make sure I understood correctly.
An update gets you B (1.1), whilst A keeps stable and requires (1.0). An assembly redirect is needed to overcome this situation.
Presuming that the update operation is done using
paket update, we could detect this situation and give the user feedback on it. I propose that neitherupdatenorrestoreoperations should automatically add/remove binding redirects but rather let the user know about it with warnings.For the sake of convenience, we could think about explicit opt-in within a
--forceoperation (which I wouldn't like at all). An alternative option would be to introduce a command, i.e.paket patch --inter-reference-constraints.@agross @forki What's your opinion on that?
agross commentedon Oct 12, 2014
Yep, I think we should make it explicit. Maybe not only the patching but another command to check whether binding redirects are required in the first place.
Alex
Alexander Groß
Tiny phone, tiny mail
On Sun, Oct 12, 2014 at 2:06 PM, ilkerde [email protected] wrote:
isaacabraham commentedon Oct 16, 2014
I've started looking this - any reason why we're using XmlDocument and not XDocument for xml manipulation?
isaacabraham commentedon Oct 16, 2014
@ilkerde I would expect to at least have the option to make the process non-interactive with e.g. --force.
forki commentedon Oct 16, 2014
XmlDocument vs. Xdocument? No idea. Use whatever makes sense to you ;-)
On Oct 16, 2014 10:54 PM, "Isaac Abraham" [email protected] wrote:
isaacabraham commentedon Oct 16, 2014
XDocument is much easier to use. At least, it was in my C# days :-)
forki commentedon Oct 16, 2014
Go for it. I'm just copying stuff from old projects...
On Oct 16, 2014 10:59 PM, "Isaac Abraham" [email protected] wrote:
isaacabraham commentedon Oct 17, 2014
What's the best place for me to integrate the code in? I have something that will take in a config file and a binding redirection and apply it to the config file (if the redirection doesn't exist, it creates it, otherwise it overwrites the existing one with the new one).
forki commentedon Oct 18, 2014
I sounds very cool. We need to discuss the scenario. When do we want this
to happen.
On Oct 17, 2014 11:32 PM, "Isaac Abraham" [email protected] wrote:
isaacabraham commentedon Oct 18, 2014
@forki IMHO as soon as possible :-) The question is how to identify web.config and app.config files that are affected by a reference change.
isaacabraham commentedon Nov 9, 2014
We had a look at this during Prog F# hackathon, I'll see where the chap got to that was doing it.