简体   繁体   English

XML元素在installshield中按字母顺序排列

[英]XML elements are arranged alphabetically in installshield

I'm using install shield to produce an msi but i have added an XML file in the XML files portion but after installing the package the XML node elements get sorted alphabetically avoiding the package to run successfully, here are the XML file nodes after installing: 我正在使用install shield生成msi,但我在XML文件部分中添加了XML文件,但是在安装软件包后,XML节点元素将按字母顺序排序,从而避免了软件包成功运行,以下是安装后的XML文件节点:

<applicationSettings>
...
</applicationSettings>
<configSections>
...
</configSections>

and here is the desired one: 这是所需的:

<configSections>
...
</configSections>
<applicationSettings>
...
</applicationSettings>

Please help me, 请帮我,

thank you very much in advance 提前非常感谢你

Relying on the XML elements order is a bad idea. 依靠XML元素顺序是一个坏主意。 You never know how that order can be changed. 您永远不知道如何更改该顺序。 Also, most setup authoring tools don't use a specific order. 此外,大多数设置创作工具都不使用特定的顺序。 Some of them sort alphabetically, others use the row order inside the package. 其中一些按字母顺序排序,其他一些则使用包内的行顺序。

I recommend modifying your application to read the XML elements as they come, regardless of order. 我建议修改您的应用程序以读取XML元素,无论其顺序如何。 This is what most applications do. 这就是大多数应用程序所做的。

Installshield appears to do this, which means the use of configSections is not possible when creating an the config via installshield. Installshield似乎可以做到这一点,这意味着在通过installshield创建config时无法使用configSections。

As for haggag87's comment, this isn't an application design issue, this is the .net framework complaining, not Cosmin's application. 至于haggag87的评论,这不是应用程序设计问题,这是.net框架在抱怨,而不是Cosmin的应用程序。

See this KB article: http://support.microsoft.com/kb/307506 请参阅此知识库文章: http : //support.microsoft.com/kb/307506

I have just tested and it is still a problem on .net 4.0 我刚刚测试过,但在.net 4.0上仍然存在问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM