Hi Paul,
Thank you for posting.
As for the System.Diagnostics Switch setting, it does has changed from .net
framework 1.1 to .net framework 2.0. In 1.1, even the folloing
configuration setting can work (without exception) and the runtime will
take the first one's value:
=====================
<system.diagnostics>
<switches>
<add name="XmlSerialization.Compilation" value="4"/>
<add name="XmlSerialization.Compilation" value="6"/>
</switches>
</system.diagnostics>
=====================
However, this is not allowed in .net framework 2.0. I have no idea of the
exact code logic however, based on my debugging, it is the
configurationRecord method of the
System.Configuration.BaseConfigurationRecord that throughs the error. And
seems 2.0 's config file parser will force us to only define a certain
switch instance(by name) once through the whole configuration
hierarchy(from machine level to application or sub app level). Therefore,
for your scenario, if you want to override a certain switch with new value,
you can first use <remove> element to remove the former definition and add
a new one. Just like:
=======================
<system.diagnostics>
<switches>
<add name="XmlSerialization.Compilation" value="4"/>
<remove name="XmlSerialization.Compilation"/>
<add name="XmlSerialization.Compilation" value="5"/>
</switches>
</system.diagnostics>
================================
Hope this helps.
Regards,
Steven Cheng
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)