简体   繁体   中英

C# WiX installer Binary Element error

I'm trying to configure IIS Sites using a WiX Installer.
Somehow my installer keeps throwing me the following error (compile time error):

The ComponentGroup element contains an unexpected child element 'Binary'.

Im trying to create a Binary element to add a certificate to the IIS Site.

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:iis="http://schemas.microsoft.com/wix/IIsExtension"

Wix reference states for Binary tag

Parents

Control, Fragment, Module, Product, UI

Your code fragment seems to have the <Binary> and <Component> tags as children of <Include> (??). Are you missing a <Fragment> tag?

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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