c**t 发帖数: 2744 | 1 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? |
c**e 发帖数: 2558 | 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?
|
c**t 发帖数: 2744 | 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.
|
c**t 发帖数: 2744 | 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.
|
c**t 发帖数: 2744 | 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"}"
|
c**e 发帖数: 2558 | 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.
|