question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Binding Redicts are added only occasionally

See original GitHub issue

Description

Can’t figure out why Binding Redirects are being added by paket only on some packages when I have set redirects: on or add --redirects parameter for paket.

Repro steps

In this simple example repo I have the following paket.dependencies file (and xunit is added to project ConsoleApplication):

redirects: on
source https://nuget.org/api/v2

nuget xunit

Now if i run any of the following

  • paket install
  • paket install -f
  • paket install -f --redirects
  • paket install -f --redirects --createnewbindingfiles

Expected behavior

Binding Redirects are added to the existing App.config file. For the package itself and also for all the transitive dependencies.

Could be that I’ve misunderstood something here, but the documentation quite clearly states:

tells paket to create Assembly Binding Redirects for all referenced libraries

So I’d assume that all libraries that are added as reference in *.csproj, would get matching Binding Redirects added to App.config as well (direct and transitive).

Actual behavior

Binding Redirects are not added. Not for the given package nor for the transitive dependencies.

Remarks and additional info

No known workarounds. I tried to add the package with --redirects flag, but this did not help. Also tried to set nuget xunit redirects: force on paket.dependencies, but no luck there either.

On the other hand in the following test paket seems to add Binding Redirect for FSharp.Core, but not for UnionArgParser: https://github.com/Gonnagle/paket-tests/releases/tag/binding-redirects-partially-working

Weirdly if I try to add FSharp.Core to the original test (next to xunit) the redirects fail to appear for this package also…

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
smoothdevelopercommented, Jan 26, 2017

@isaacabraham that behaviour is easy enough to document 😆

0reactions
Gonnaglecommented, Sep 25, 2017

Just tested this with 5.100.2 and it seems that the solution wide option at paket.dependencies now works as expected. So changing it as follows:

redirects: force
source https://nuget.org/api/v2

nuget xunit redirects: force

And running paket install -f now creates the binding redirects as expected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Assembly binding redirect does not work
This was the answer. The binding redirects were silently ignored because my web.config was so old it had the 2.0 namespace. – Sören...
Read more >
Redirecting Assembly Versions - .NET Framework
Redirect compile-time binding references to different versions of .NET assemblies, third-party assemblies, or your own app's assemblies.
Read more >
Binding Redirects
Note that binding redirects are to remedy differences in the reference chain (more on that below), so when all of your things reference...
Read more >
Solved: How to set binding redirects?
The suggested workaround is to use assembly binding redirects in the app.config, but the ArcGIS add-in does not seem to use app.config file....
Read more >
Could not load file or assembly… NuGet Assembly Redirects
Sometimes, old binding redirects are not removed. Sometimes, none are added at all. Resulting in fine errors like the ones I opened this ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found