简体   繁体   English

C#WiX安装程序二进制元素错误

[英]C# WiX installer Binary Element error

I'm trying to configure IIS Sites using a WiX Installer. 我正在尝试使用WiX安装程序配置IIS站点。
Somehow my installer keeps throwing me the following error (compile time error): 安装程序以某种方式不断向我抛出以下错误 (编译时错误):

The ComponentGroup element contains an unexpected child element 'Binary'. ComponentGroup元素包含意外的子元素“ Binary”。

Im trying to create a Binary element to add a certificate to the IIS Site. 我正在尝试创建一个Binary元素以将证书添加到IIS站点。

Code Sample 代码样例

<?xml version="1.0" encoding="utf-8"?>
<Include
  xmlns="http://schemas.microsoft.com/wix/2006/wi"
  xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension">

  <Binary Id="myCert.Binary" SourceFile="$(var.ProjectDir)Certificates\myCert.pfx" />
  <Component Id="IISWebsiteFlex" Guid="{********-79BF-4317-****-317FE4C8DEAC}" Directory="INSTALLFOLDERFLEX" KeyPath="yes">
    <!--IIS Site aanmaken-->
    <iis:Certificate Id="ActaNet3Certificate"
                     StoreName="root"
                     Overwrite="yes"
                     Name="fabrikam.com"
                     StoreLocation="localMachine"
                     Request="no"
                     BinaryKey="myCert.Binary" 
                     PFXPassword="MyPFXPassword"                     
                     />

Usually the problem is in the XMLNS namespace but I did add: 通常问题出在XMLNS命名空间中,但我确实添加了:

xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension" xmlns:iis =“ http://schemas.microsoft.com/wix/IIsExtension”

Wix reference states for Binary tag 二进制标记的Wix参考状态

Parents 父母

Control, Fragment, Module, Product, UI 控件,片段,模块,产品,UI

Your code fragment seems to have the <Binary> and <Component> tags as children of <Include> (??). 您的代码片段似乎具有<Binary><Component>标记作为<Include> (??)的子代。 Are you missing a <Fragment> tag? 您是否缺少<Fragment>标签?

Also, should that be Include? 另外,应该包含吗? Or should it be Wix 还是应该是蜡

<Wix
  xmlns="http://schemas.microsoft.com/wix/2006/wi"
  xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension">

  <Fragment> ... </Fragment>
</Wix>

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

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