app.config 中元素的顺序重要吗?
我已经看到并遇到了 app.config/web.config 的问题,其中我更改了元素的顺序,并且应用程序停止工作。 我相信我通过查看 machine.config 并按照其中的顺序解决了问题。
一个示例是以下问题: Common.Logging config 异常
该问题已解决通过更改元素在文件中出现的顺序。
那么,问题是,元素的顺序重要吗?
It appears to me it does.If it does, is it documented anywhere, an xsd schema maybe?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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看来至少对于 configSections 元素顺序确实很重要。
文档 http://msdn.microsoft.com/en-us/library/ms228256。 aspx 声明如下:
"If the configSections element is in a configuration file, the configSections element must be the first child element of the configuration element."
我从这里得到这个: http://social.msdn.microsoft.com/Forums/en-US/clr/thread/60c7b502-f7fc-49e9-b4b0-771b4fb4134e
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
这里有网络配置的完整解释。订单和所需的标签。
http://msdn.microsoft.com/en-us/库/ackhksh7(vs.71).aspx
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