T
ThomasD
I am using TraceSource to log errors and such. I have a custom
tracelistener I use for this, and this is setup in the app.config like
this:
<system.diagnostics>
<trace autoflush="true"/>
<sources>
<source switchValue="All" name="Application" >
<listeners>
<add name="LogFile"></add>
</listeners>
</source>
</sources>
<sharedListeners>
<add name="LogFile" initializeData="AppLog;5000"
type="FileTraceListener, MyTools"></add>
</sharedListeners>
</system.diagnostics>
Now, using this technique I will actually need an app.config for each
and every assembly in the project. Which I really want to.
How do I share this app.config between all assemblies? It is so very
easy to change the trace configuration by simply editing this
app.config, instead of doing it through code.
I have been looking at ConfigurationManager, which lead me nowhere,
and AppDomain.SetupInformation, which is only useful when creating NEW
application domains.
So, is there any way to share an app.config file between several
assemblies, without resorting to XmlDocument and lots of coding.
tracelistener I use for this, and this is setup in the app.config like
this:
<system.diagnostics>
<trace autoflush="true"/>
<sources>
<source switchValue="All" name="Application" >
<listeners>
<add name="LogFile"></add>
</listeners>
</source>
</sources>
<sharedListeners>
<add name="LogFile" initializeData="AppLog;5000"
type="FileTraceListener, MyTools"></add>
</sharedListeners>
</system.diagnostics>
Now, using this technique I will actually need an app.config for each
and every assembly in the project. Which I really want to.
How do I share this app.config between all assemblies? It is so very
easy to change the trace configuration by simply editing this
app.config, instead of doing it through code.
I have been looking at ConfigurationManager, which lead me nowhere,
and AppDomain.SetupInformation, which is only useful when creating NEW
application domains.
So, is there any way to share an app.config file between several
assemblies, without resorting to XmlDocument and lots of coding.