avatar
c*e
2
you can implement custom section handlers. start from here:
http://msdn2.microsoft.com/en-us/library/ms228062(VS.80).aspx
you don't need to be limited to using appSettings and can
define your own structure of configuration

l
more.

【在 c**t 的大作中提到】
: In .Net 1.1-, there is a good example to write our own appSettings handler l
: ike http://www.codeproject.com/dotnet/namevaluemultiple.asp?df=100&forumid=1
: 5760&select=2229833&msg=2229833. But in .Net 2.0+, it doesn't work any more.
: Any solution?

avatar
c*t
3
Having a project using appSettings like the link I had given; I tried MSDN
suggestion, it doesn't allow the customized section name like appSettings.

【在 c**e 的大作中提到】
: you can implement custom section handlers. start from here:
: http://msdn2.microsoft.com/en-us/library/ms228062(VS.80).aspx
: you don't need to be limited to using appSettings and can
: define your own structure of configuration
:
: l
: more.

avatar
c*t
4
It always claims "[System.Configuration.ConfigurationErrorsException] = {"
Configuration system failed to initialize"}"

【在 c**t 的大作中提到】
: Having a project using appSettings like the link I had given; I tried MSDN
: suggestion, it doesn't allow the customized section name like appSettings.

avatar
c*t
5
Microsoft has removed the ability to remove section handlers, which means
that
we can NOT deregister the default appSettings handler and register a new one
. Microsoft reduced configurability flexibility by preventing the removal of
section handlers.

【在 c**t 的大作中提到】
: It always claims "[System.Configuration.ConfigurationErrorsException] = {"
: Configuration system failed to initialize"}"

avatar
c*e
6
i guess that's because they introduced ConfigurationManager class
in 2.0 to ease working with appSettings and connectionStrings (thru
ConfigurationManager.AppSettings and ConfigurationManager.ConnectionStrings).
they probably don't want you to replace handlers for these sections
with your own.
for new code, i'd suggest (as in my previous post) to implement your own
section handlers, which gives you much more flexibility than appSettings,
etc
you can support whatever schemas you design in configu

【在 c**t 的大作中提到】
: Microsoft has removed the ability to remove section handlers, which means
: that
: we can NOT deregister the default appSettings handler and register a new one
: . Microsoft reduced configurability flexibility by preventing the removal of
: section handlers.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。