How to roll out binding redirects to customer sites

64 Views Asked by At

.Net Windows desktop software: Scenario is that the .exe.config files on customer machines contain two kinds of information:

  1. Site-specific application settings
  2. Binding redirects required by various nuget packages

As the nuget package dependencies evolve over time, the binding redirects need updating. Can't simply replace the files because of the site-specific settings, hence they have to be updated.

I have written code to do that, but given the number of sites that must have this issue, it feels odd that roll-your-own is necessary, so my questions are:

  • Is it necessary to update the physical files on the customer machines or is there anything (eg in Visual Studio) that means I can avoid this?
  • If so, is there an app or a VS component to do this, or do I need to shuffle XElements around via an updater app?

Many thanks

1

There are 1 best solutions below

0
paulipopsis On

The solution is to use a separate linkedConfiguration file to hold the redirects, enabling the applicationSettings to remain constant while the linkedConfiguration file can be updated along with the code.

Full details and many thanks to Aaron Bickle at

xcentium.com/blog/2019/09/04/externalizing-assembly-redirects