将Wix 3.0迁移到Wix 4.0时出现错误:WXCP0006:此节点之前的空白不正确(WhitespacePrecedingNodeWrong) [英] When migrating Wix 3.0 to Wix 4.0 getting error : WXCP0006 : The whitespace preceding this node is incorrect (WhitespacePrecedingNodeWrong)

查看:140
本文介绍了将Wix 3.0迁移到Wix 4.0时出现错误:WXCP0006:此节点之前的空白不正确(WhitespacePrecedingNodeWrong)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用WixCOP将Wix 3.0迁移到Wix 4.0时,出现错误WXCP0006:该节点之前的空白不正确(WhitespacePrecedingNodeWrong)

When I am migrating Wix 3.0 to Wix 4.0 using WixCOP I am getting the error WXCP0006 : The whitespace preceding this node is incorrect (WhitespacePrecedingNodeWrong)

我正在运行以下命令

WixCop.exe -f E:\ Test \ Wix \ src \ UI * .wxs.

WixCop.exe -f E:\Test\Wix\src\UI*.wxs.

当我运行相同的命令从Wix 2.0迁移到Wix 3.0时,我没有遇到任何错误.

When i run the same command to migrate from Wix 2.0 to Wix 3.0 i didn't get any errors.

UPDATE :感谢您提供详细信息.

UPDATE: Thank you for the detailed information.

1)我多次运行以下命令,并得到相同的错误.

1) I run the below command multiple times and getting the same errors.

WixCop.exe -f E:\ Test \ Wix \ src \ UI * .wxs.

WixCop.exe -f E:\Test\Wix\src\UI*.wxs.

2)运行该命令后,我看到.WXS文件中的更改(命名空间和其他更改)

2) I am seeing the changes in the .WXS files (namespace and other changes) after I run that command

3)我想知道如何配置不正确的空格(我的意思是wix40-binaries bcz中的哪个文件我只见过很少的.config文件,但与wixcop无关)

3) I wanted to know how to configure the incorrect white space ( I mean which file in wix40-binaries bcz i have seen few .config files but those are are not related to wixcop)

我还可以在哪个文件中禁止显示"WhitespacePrecedingNodeWrong"命令?

And also in which file i can suppress the command "WhitespacePrecedingNodeWrong" ?

当我最初从wix 2.0迁移到wix 3.0时,我遇到了whispace错误.然后,当我运行以下修复错误"命令时,这些错误已解决 WixCop.exe -f E:\ Test \ Wix \ src \ UI * .wxs.

When i was migrating from wix 2.0 to wix 3.0 initially i got the whispace errors. Then when i run the below Fix errors command those errors were resolved WixCop.exe -f E:\Test\Wix\src\UI*.wxs.

但是从wix 3.0迁移到wix 4.0时,为什么此命令不能解决这些错误?

But when migrating from wix 3.0 to wix 4.0 why this command is not resolving these errors?

推荐答案

UPDATE2 :也许您可以更好地记录每个文件的结果-看看有什么坏处.这是一个建议(我很久以来一直试图忘记批处理文件,所以请原谅 任何缺乏优雅的东西.此处不保证其合理性:

UPDATE2: Maybe you can log the results per file better - to see what breaks. Here is one proposal (I have long tried to forget about batch files, so pardon any lacking elegance. No guarantees for the sanity herein):

for %h in (*.wxs) do wixcop -f "%h" -set1Test.xml >> Log.log

其中 Test.xml 是以下部分中描述的设置文件.或在没有设置文件的情况下运行:

Where Test.xml is the settings file described in a section below. Or run without the settings file:

for %h in (*.wxs) do wixcop -f "%h" >> Log.log

上面的命令显然要小心!!它们将以目标文件夹中的所有WiX源文件为目标-在您的情况下,这是您想要的,但对于其他找到命令行的人:警告.

Obviously be careful with the above commands! They will target all WiX source files in the target folder - which in your case is what you want, but for others who find the command lines: caution.

更新:

  1. Pinpoint :您可以尝试在文件的子集上运行命令还是对每个文件运行一次,以便确定哪个文件导致实际问题?另一种查找方法是在所有文件上运行(使用当前的通配符方法),然后查看未更新哪些文件?

未更改的文件? :如上所述,请尝试确定哪些文件未更新.如果有的话.不变的文件可能会触发错误,从而中止更新操作?

Unchanged Files?: As I said above, please try to determine what files have not been updated. If any. Unchanged files may trigger errors that abort the update operation?

抑制错误 :除了在

Suppress Errors: I don't know of any sample settings files apart from what is found in the documentation I linked to earlier. Let's try to build a simple settings file to ignore two types of errors:

File Name: Test.xml

<Settings>
   <IgnoreErrors>
     <Test Id="WhitespacePrecedingNodeWrong" />
     <Test Id="WhitespacePrecedingEndElementWrong" />   
   </IgnoreErrors> 
</Settings>

Command Line To Use: wixcop.exe -f Product.wxs -set1Test.xml

  • 解决方案 :简短的回答是,我不知道为什么这次您遇到无法解决的问题.如前所述,请尝试使用上述建议将问题缩小到单个文件或一组文件.

  • Resolution: Short answer is I don't know why you have unresolvable problems this time. As stated, please try to narrow down the problem to a single file - or group of files - if possible using the suggestions above.


    更正,将进行新的纠正 (


    Correction, New Rectification Follows (practicing tautologies): If you run the command again on the same file(s), are the errors gone? It seems the WiX file is still updated (so far as it is writable) - despite the error messages - and what happens is that the process fixes indentation and line feed inconsistencies (among other things) so the source file complies with the WiX standard (or your own standard) afterwards.

    设置标准 :您看到的错误是指出您的源文件中存在空白不一致.例如,这可能仅仅是错误的压痕数量.根据 Bob Arnson's 此处的WiX Cop文章:

    Setting The Standard: What you see is an error stating that there are white space inconsistencies in your source file. This could be a mere errornous number of indentations - for example. According to Bob Arnson's WiX Cop piece here: http://www.joyofsetup.com/2008/03/26/wix-goodies-wixcop the detection of incorrect white space is configurable - as are many other parameters for other checks beyond white space. You need to provide settings files and define the right command line switches to set your own standard. You might want to suppress some tests and fixes for example. There is a brief sample of a settings file in the online documentation link below.

    WiXCop.exe :在这里,我将不再重复所有详细信息,请参见上面的Arnson帖子,或者通过以下方式运行 wixcop /? :命令行以获取可用命令行开关的列表(当然必须安装WiX,并且路径中需要WiX Bin directory ).您还可以在 用于WiXCop.exe的WiX联机文档中查看所有开关. .

    我认为总体总结是 WiXCop.exe 将常规MSI文件验证扩展了一步,方法是在编译为MSI格式之前直接验证WiX XML源文件.当在WiX版本之间进行架构更改需要批量更新时,它可以帮助迁移源.

    I guess the overall summary is that WiXCop.exe extends normal MSI file validation a step further by validating the WiX XML source file directly before compilation to MSI format. And it helps migrate sources when batch updates are required for schema changes between WiX versions.

    令我有些惊讶的是,WiX XML更新过程没有自动备份功能.我想有一个很好的理由不这样做.在运行WiXCop之前,请对源文件进行备份,然后与一个好的diff工具进行比较.我使用超越比较.

    I am a bit surprised there is no auto-backup feature for the WiX XML update process. I guess there is a good reason why this is not done. Make a backup of your source files before running WiXCop and then compare with a good diff tool. I use Beyond Compare.

    这篇关于将Wix 3.0迁移到Wix 4.0时出现错误:WXCP0006:此节点之前的空白不正确(WhitespacePrecedingNodeWrong)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆