Nick Prozee
Nick Prozee

Reputation: 2913

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"

Upvotes: 0

Views: 495

Answers (1)

Brian Sutherland
Brian Sutherland

Reputation: 4798

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>

Upvotes: 1

Related Questions