Does the CLR cache .config values or tracing levels?
-
It does make sense to me that it would, but when I have multiple assemblies that examine the (TraceLevelSwitch), which is configure for a different value in each assembly. However, they all seem to operate on the same value, rather than the one configured in the individual .config files. Detail: Assembly A - .dll Assembly B - .dll Assembly C - windows forms app .exe All assemblies use the following code: private static System.Diagnostics.TraceSwitch _TraceLevelSwitch = new System.Diagnostics.TraceSwitch("TraceLevelSwitch", "Tracing level"); All assemblies seem to pick up the value for Assembly C, which runs/loads first. Anyone got some insight into this?
-
It does make sense to me that it would, but when I have multiple assemblies that examine the (TraceLevelSwitch), which is configure for a different value in each assembly. However, they all seem to operate on the same value, rather than the one configured in the individual .config files. Detail: Assembly A - .dll Assembly B - .dll Assembly C - windows forms app .exe All assemblies use the following code: private static System.Diagnostics.TraceSwitch _TraceLevelSwitch = new System.Diagnostics.TraceSwitch("TraceLevelSwitch", "Tracing level"); All assemblies seem to pick up the value for Assembly C, which runs/loads first. Anyone got some insight into this?
.DLL's can't have their own config files. They'll always use the .EXE's config in which their running. Dave Kreskowiak Microsoft MVP - Visual Basic
-
.DLL's can't have their own config files. They'll always use the .EXE's config in which their running. Dave Kreskowiak Microsoft MVP - Visual Basic
I was afraid of that. Perhaps I could use different explicit switches in the main app's .config? Thanks for the reply.
-
I was afraid of that. Perhaps I could use different explicit switches in the main app's .config? Thanks for the reply.
The configuration is on the AppDomain level. If you're bonkers enough you can create a new appdomain, set its base directory/config file path etc, load your satellite assemblies in to that, and call them dynamically, but its a rubbish idea and I wish I'd never said anything now. Regards, Rob Philpott.
-
The configuration is on the AppDomain level. If you're bonkers enough you can create a new appdomain, set its base directory/config file path etc, load your satellite assemblies in to that, and call them dynamically, but its a rubbish idea and I wish I'd never said anything now. Regards, Rob Philpott.
No Worries. By constructing the key (value) name at run-time, based on the assembly name, I can control the behavior of each assembly individually from one .config file, which is a better solution anyway.:-D Thanks for the info.
-
The configuration is on the AppDomain level. If you're bonkers enough you can create a new appdomain, set its base directory/config file path etc, load your satellite assemblies in to that, and call them dynamically, but its a rubbish idea and I wish I'd never said anything now. Regards, Rob Philpott.
Rob Philpott wrote:
but its a rubbish idea and I wish I'd never said anything now.
:laugh::laugh::laugh: Dave Kreskowiak Microsoft MVP - Visual Basic