Does the order of elements in app.config matter?
I have seen and experienced problems with app.config/web.config where I had changed the order of elemen开发者_如何转开发ts 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?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
here you have the entire explanation of the web config. the order and the requiered tag.
http://msdn.microsoft.com/en-us/library/ackhksh7(vs.71).aspx
精彩评论