Click here to Skip to main content
15,072,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I can't manage to get my app to reload or refresh it's loaded settings.
This is a section I have in my exe.config:

    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <assemblyIdentity name="TestMode" publicKeyToken="22ws3erfvbgt6543" culture="neutral" />
        <bindingRedirect oldVersion="" newVersion=""/>

What I have tried:

I need to change the newVersion to which I can do easily.
The question is how do you do this without shutting down the program.
Updated 28-Jan-21 17:20pm

1 solution

AFAIK, you cannot. It's applications runtime configuration which would need app to be stopped to reload for any change as it binding redirects would be mapped to app startup.

If you want to try, you can dynamically bind to a different version of an assemblytry using AppDomain.AssemblyResolve event which fired whenever the runtime is unable to locate the exact assembly that the application was linked against.

But again for a code change like this, you would need to restart app. So, without restarting - referring to another version would not be possible.
A good read: How the Runtime Locates Assemblies | Microsoft Docs[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900