I have a scenario where I need to keep a C#/.Net program running, but it might need to update the configuration for Application Insights. It does this currently by Initializing a new configuration class, creating a new client with the new configuration, then disposing the old configuration. However, I found that after each configuration change, the old threads for perf and dependency collection were not disposed along with the configuration and so it causes excess threads and telemetry to be sent to Application Insights. Now it's possible there's a better way for me to change the configuration without restarting my program, but I am confused as to why the extra threads are not terminated.
I have a scenario where I need to keep a C#/.Net program running, but it might need to update the configuration for Application Insights. It does this currently by Initializing a new configuration class, creating a new client with the new configuration, then disposing the old configuration. However, I found that after each configuration change, the old threads for perf and dependency collection were not disposed along with the configuration and so it causes excess threads and telemetry to be sent to Application Insights. Now it's possible there's a better way for me to change the configuration without restarting my program, but I am confused as to why the extra threads are not terminated.