title: Convert Virtual Directory to Web Application in WiX
body: <p>I am creating a new <code>WebSite</code> whenever Feature A or B is installed:</p>
  
  <pre><code>&lt;Component Id="IIS.HelloWorld" Guid="6FA5EF90-C9D9-463C-9CC7-0410670AFBD1" Directory="TARGETDIR"&gt;
    &lt;iis:WebSite Id="IIS.HelloWorld" Description="Hello World for Web" Directory="INSTALLDIR"&gt;
      &lt;iis:WebAddress Id="HelloWorldAddress" IP="*" Port="8080"/&gt;
    &lt;/iis:WebSite&gt;
  &lt;/Component&gt;
  </code></pre>
  
  <p>The WebSite is pointed to the INSTALLDIR (Say C:\MyFiles). Below the INSTALLDIR, I have 2 additional folders: <strong>Service</strong> (C:\MyFiles\Service) and <strong>Web</strong> (C:\MyFiles\Web)</p>
  
  <p>Since the WebSite is pointed to INSTALLDIR, all sub-directories (<strong>Service</strong> and <strong>Web</strong>) were automatically treated as Virtual Directories (?) -- I can see them linked via IIS Management Console and I can access them via my browser.</p>
  
  <p>However, they need to be "converted" to Applications (done manually by right-clicking the Virtual Directory and selecting "Convert to Application) in order for them to work properly (they contain ASPX and ASMX files).</p>
  
  <p>So I've added the following component to try to convert them to "Applications":</p>
  
  <pre><code>&lt;Component Id="IIS.HelloWorld.WebSite.VirtualDirectory" Guid="GUID-44D1-48D9-BB3C-4B0126FB83E5" Directory="TARGETDIR"&gt;
    &lt;iis:WebVirtualDir Id="IIS.HelloWorld.WebSite.VirtualDirectory" Alias="Service" Directory="INSTALLDIR.WebSite" WebSite="IIS.HelloWorld"&gt;
      &lt;iis:WebApplication Id="IIS.HelloWorld.WebSite.VirtualDirectory" Name="Service"/&gt;
    &lt;/iis:WebVirtualDir&gt;
  &lt;/Component&gt;
  </code></pre>
  
  <p>But the Virtual Directories wasn't converted to "Applications"; they are still just virtual directories.</p>
  
  <p>Question: How do I convert virtual directories to applications in WiX? Or what is the proper way to handle this situation?</p>
  
  <p>Thanks!</p>