app.config 中元素的顺序重要吗?

发布于 2024-11-25 14:59:43 字数 412 浏览 3 评论 0原文

我已经看到并遇到了 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

半仙 2024-12-02 14:59:43

看来至少对于 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

岁月如刀 2024-12-02 14:59:43

这里有网络配置的完整解释。订单和所需的标签。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文