2014-04-07 162 views
1

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

?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'. 

回答

3

发现了这件事。包含的xml中有这个“ - >”注释标签。这是错误的原因。如果有某种功能来检查错字会更好。误导性的错误信息。

+0

我有一个愚蠢的“某处。 – TomEberhard

+0

一个额外的>对我来说,圣洁的废话我不能相信这个错误信息是如此糟糕。 – Hrethric

0

的错误消息是相当不言自明 - include指令应该是那些元素之一的孩子:Bundle Product Module Patch Fragment PatchCreation。看来Fragment最适合您的场景。

所以,尽量修改方式如下:

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