繁体   English   中英

Wix安装程序PropertyRef模式验证错误

[英]Wix Installer PropertyRef schema validation error

PropertyRef元素添加到我的Package元素会在编译过程中产生错误。

这是我的* .wxs文件

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
 xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
  <Product Id="*" Name="MyProduct" Language="1033" Version="!(bind.FileVersion.MyApplication.exe)" Manufacturer="MyManufacturer" UpgradeCode="SOME-GUID">
    <PropertyRef Id="WIX_IS_NETFRAMEWORK_461_OR_LATER_INSTALLED" />
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
    ...
  </Product>
  ...
</Wix>

这是Visual Studio产生的错误:

Schema validation failed with the following error at line 1, column 588: The element 'Product' in namespace 'http://schemas.microsoft.com/wix/2006/wi' has invalid child element 'PropertyRef' in namespace 'http://schemas.microsoft.com/wix/2006/wi'. List of possible elements expected: 'Package'.

查看PropertyRef的文档会发现Product应该是PropertyRef的有效父代。

可以通过将PropertyRef元素放在Package元素之后来解决此错误。

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
 xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
  <Product Id="*" Name="MyProduct" Language="1033" Version="!(bind.FileVersion.MyApplication.exe)" Manufacturer="MyManufacturer" UpgradeCode="SOME-GUID">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
    <PropertyRef Id="WIX_IS_NETFRAMEWORK_461_OR_LATER_INSTALLED" />
    ...
  </Product>
  ...
</Wix>

暂无
暂无

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

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