I have seen and experienced problems with app.config/web.config where I had changed the order of elements and the app stopped working. I believe I fixed the problem by looking at machine.config and following the order in there.
One example is the following question: Common.Logging config exception
The issue was resolved by changing the order the elements appear in the file.
So, the question is, does the order of elements matter?
It appears to me it does. If it does, is it documented anywhere, an xsd schema maybe?You cannot use multiple configuration files (i.e. one per library project) without coding.
Web. Config is used for asp.net web projects / web services. App. Config is used for Windows Forms, Windows Services, Console Apps and WPF applications.
App. Config is an XML file that is used as a configuration file for your application. In other words, you store inside it any setting that you may want to change without having to change code (and recompiling). It is often used to store connection strings.
The application configuration file usually lives in the same directory as your application. For web applications, it is named Web. config. For non-web applications, it starts life with the name of App.
It appears that at least for the configSections
element order does matter.
Document http://msdn.microsoft.com/en-us/library/ms228256.aspx states the following:
"If the configSections element is in a configuration file, the configSections element must be the first child element of the configuration element."I got this from here: http://social.msdn.microsoft.com/Forums/en-US/clr/thread/60c7b502-f7fc-49e9-b4b0-771b4fb4134e
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With