-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Binding redirects not generated for .NET 4.7.2 transitive dependency chains with System.Buffers #27492
Comments
@joperezr did you get chance to take a look at it? |
I see what is happening here. The problem is that System.IO.Pipelines only depends on System.Buffers (4.0.2 version) on the implementation assembly, not on the reference assembly. The task in charge of auto-generating the binding redirects only receives reference assemblies, and based on those, it will decide which redirects you will need. In this case, System.IO.Pipelines reference assembly doesn't depend on System.Buffers, so this task will only see the 4.0.3 version, and won't suggest a binding redirect to fix the conflict. One possible solution would be to add this target on the consuming .exe project which will basically use the implementation assemblies instead of the reference assemblies so RAR would now suggest the right binding redirects. We are currently trying to find a solution for this exact problem on this issue: #27470 So you might also find useful information there. |
Thanks @joperezr. Would it make sense to duplicate this issue against the one you linked? (assuming @NickCraver is ok with that) |
Yup, I would close this as a dupe of #27470 |
Duplicate of #27470 |
@joperezr note that GH recognizes the "Duplicate of #abc" form ;) |
😄 noted! |
We've getting a lot of bug reports on StackExchange.Redis especially with Azure functions and general .exe usage of our library after our v2.0 release based on System.IO.Pipelines.
Some examples:
When a
.exe
project references a lib that references both System.Buffers 4.5.0 (4.0.3 assembly version) and System.IO.Pipelines (4.5.1), which itself references System.Buffer 4.4.0 (4.0.2 assembly version), what's needed is a redirect from 4.0.2 to 4.0.3. Despite having<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
, this is not generated.I have a minimal repro of the issue that's easy to test out here: https://github.com/NickCraver/BindingRepro
Here's the reference tree in that repo:
To mitigate this issue for as many people as possible, we have released a new version of
Pipelines.Sockets.Unofficial
(v1.0.7, the production equivalent ofRefPipelines
above), which drops our dependency onSystem.Buffers
from4.5.0
to 4.4.0 (to matchSystem.IO.Pipelines
). This fixes our test case and hopefully Azure Functions for others. But this remains a workaround and a very brittle one. The root cause remains. Given .NET 4.7.2 was supposed to eliminate pain here and isn't...what should we be doing? Isn't this something that should be generated? e.g.cc @mgravell @terrajobst @karelz @joperezr
The text was updated successfully, but these errors were encountered: