Hi Chuck,
As for the "how to test the missing of a configuration section in .net
config file", I think it a good question. However, based on my research,
the current .NET configuration settings model doesn't provide support of
detecting the existence of a configuration section automatically(only the
detection of a sub section properrty is supported). This limitation is due
to the following design of the configuration section processing mechanism:
** When .net application runs, it will not always load all the
configuration settings at one time or at the startup time. The loading of
each configuration section is on-demand and may occur at different time.
Thus, it won't be convenient to check all the potential configsection's
existence.
** So far <configSections><sectionelement only support the definition of
the scope and modify-behavior of the registered section, haven't provided
setting to control the existence detection
For your scenario, if you do need to take care of some certain custom
configuration's existence, I think you may consider manually use the
configuration API to query the certain section in code or use XML API to
perform xml query against the app.config file.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.