3
votes

I'm creating website with custom application pool settings using WIX. After installation my new website is using Default Application Pool instead of using the one that I'm creating during installation. I could find ways for virtual directory to point to newly created app pool but seems iis:WebSite does not have attribute for setting app pool.

Here is my code:

<iis:WebSite Id="MyWebSite" Description='MyWebsiteDesc' SiteId='*' Directory='MyWebFolder'>
  <iis:WebAddress Id="AllUnassigned" Port="80" />
</iis:WebSite>

<util:User Id="MyAppPoolUser" 
           CreateUser="no" 
           Name="[APPPOOL_USER]" 
           Password="[APPPOOL_PASS]" 
           Domain="." />

<iis:WebAppPool Id="MyAppPool" 
                Name="[WEB_APP_NAME]" 
                Identity="other" 
                User="MyAppPoolUser" 
                ManagedRuntimeVersion="v4.0" 
                ManagedPipelineMode="Integrated"  />
3

3 Answers

4
votes

Use IIS:WebVirtualDir/IIS:WebApplication to point to your AppPool.

Hope, this might help you.

1
votes

You have created an application pool but you have only created a web site. To use the application pool, you must create a virtual directory or application within the website. Both the WebVirtualDir and WebApplication elements have a WebAppPool attribute that you can use to configure IIS to use the application pool you are creating.

0
votes

I recently faced this issue. All my web application inside website were assigned new app pool I created but base website was having DefaultAppPool.

This is the trick to assign app pool to base website

 <iis:WebAppPool Id="MyAppPool" Name="YourAppPoolName" Identity="applicationPoolIdentity" />

     <iis:WebSite Id='MyWebSite' Description='Dummy' Directory='APPLICATIONFOLDER'>   

    <iis:WebApplication Id="AnyId" Name="Dummy" WebAppPool="MyAppPool" />  

 </iis:WebSite>