Question

I'm creating an installer that deploys my MVC app to IIS7 using Wix Toolset. I have this code which I found on this: https://stackoverflow.com/a/3154259/2063610

It it throws an error that says: The Directory element contains an unexpected child element 'iis:WebVirtualDir'.

I'm sure I've included the schema and added the WixIISExtension to the references so it should be working. Here's the whole code:

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

   <Product Id="6FAD9EC7-D2B0-4471-A657-C8AF5F6F707F" Name="Vince Wix 3 Web Service" Language="1033" Version="1.0.0.0" Manufacturer="Vince LLC" UpgradeCode="6FAD9EC7-D2B0-4471-A657-C8AF5F6F707F"> <Package InstallerVersion="200" Compressed="yes" />

<Media Id="1" Cabinet="WebAppWixProject.cab" EmbedCab="yes" />

<iis:WebSite Id='DefaultWebSite' Description='Default Web Site' Directory='WEBDIRECTORY'>   <iis:WebAddress IP="*" Id="AllUnassigned" Port="80" /> </iis:WebSite>    <Directory Id="TARGETDIR" Name="SourceDir">   <Directory Id="ProgramFilesFolder">
    <Directory Id="WebApplicationFolder" Name="MyWebApp">
      <iis:WebVirtualDir Id="ProductVirtualDirectory" Alias="foo" Directory="WEBDIRECTORY" WebSite="DefaultWebSite">
        <iis:WebApplication Id="ERIC6_Deploy" Name="Web Application 1"/> 
      </iis:WebVirtualDir>
    </Directory>   </Directory> </Directory>

<Feature Id="ProductFeature" Title="WixProject" Level="1">
    <ComponentRef Id="IIS.Component" /> </Feature>


 </Product>    </Wix>

Can anyone help me out on this? I'm a Wix noob and been studying it since yesterday but still can't get my simple installer work..:/

Was it helpful?

Solution

Take a closer look at the answer you posted as example; you can't have a WebVirtualDir as a direct child of a Directory, you are missing a Component node between them:

<Directory Id="WebApplicationFolder" Name="MyWebApp">
  <Component Id="IIS.Component" Guid="YOUR-GUID-HERE" KeyPath="yes">
    <iis:WebVirtualDir Id="ProductVirtualDirectory" Alias="foo" Directory="WEBDIRECTORY" WebSite="DefaultWebSite">
      <iis:WebApplication Id="ERIC6_Deploy" Name="Web Application 1"/> 
    </iis:WebVirtualDir>
  </Component>
</Directory>

Remember to replace YOUR-GUID-HERE with a GUID generated by yourself!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top