0

.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

  • Have you considered putting site-specific settings somewhere else? You can specify settings as 'user settings', and this stores them in a separate config file in localappdata, or some completely different way to manage application settings. – JonasH Nov 01 '21 at 08:59
  • I have wondered about moving the settings out of that file. I don't think user settings is the answer as these are truly site rather than user settings, but I could use a standalone settings infrastructure - but it seems like a waste of the one provided by .net – paulipopsis Nov 01 '21 at 09:05

1 Answers1

1

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