Wix包含元素不起作用

时间:2014-04-07 13:04:33

标签: wix windows-installer

我正在使用一个非常简单的声明来包含一个包含wix安装程序变量定义的文件。这仅在64位MSI安装程序中失败。

?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?include $(var.ProjectDir)\Includes\Variables.wxi ?>

我收到以下错误:

Schema validation failed with the following error at line 1, column 245: The element 'Wix' in namespace 'http://schemas.microsoft.com/wix/2006/wi' cannot contain text. List of possible elements expected: 'Bundle Product Module Patch Fragment PatchCreation'.

2 个答案:

答案 0 :(得分:4)

找到它。有这个“ - &gt;”注释结束标记存在于包含的xml中。这是错误的原因。如果有某种功能来检查拼写错误会更好。误导性错误信息。

答案 1 :(得分:0)

错误消息非常明显 - include指令应该是其中一个元素的子节点:Bundle Product Module Patch Fragment PatchCreationFragment似乎最适合您的情况。

因此,尝试按以下方式修改它:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
  <?include $(var.ProjectDir)\Includes\Variables.wxi ?>
</Fragment>