Description
We are currently using GeneratedBindingRedirectsAction=Overwrite
, which appears to only add or modify existing binding redirects, but it doesn't touch any potentially stale ones.
Because of this behavior, we got to a point where we started seeing binding errors after package upgrades, as some of the previous redirects in the web.config
file became stale and then started to conflict with transitive dependencies again.
To fix this issue, we manually deleted the entire binding redirects section from each of our 7 projects that rely on this SDK, and let it regenerate all of the bindings again from scratch after a new rebuild. This refresh worked fine.
What worries me the most is that we had already done such a refresh at one point right after making the SDK conversion, so these stale/incorrect entries were filled completely automatically by many package updates since then.
I'd like to avoid having to ever do this process again. It is super error prone, and it is complicated to do as it requires deep understanding of redirects which most modern developers are not aware of.
I'd like to propose a new option for the GeneratedBindingRedirectsAction
that instead of just updating existing redirects or add missing ones, completely replaces the entire <runtime>
section with a freshly generated one. We'd then use this option for every single one of our projects so that package management always results in the leanest possible list of redirects and we don't ever run into the issues we ran into again.