1

I have tried this answer, but this just adds the MIME types to the virtual application, not to the web site itself.

According to WiX documentation for MimeMap element, MimeMap has two parents, WebSite and WebVirtualDir, so it should be able to be applied to the web site, however it doesn't seem to do anything. Also I cannot see anything in the logs to indicate why it has failed.

How can I get the WiX installer to add the MIME types to the web site instead?

Code:

<!-- configure iis -->
<Component Id="CMP_iisConfig" Guid="MY_GUID_HERE" KeyPath="yes">

    <!-- configure application pool -->
    <iis:WebAppPool Id="APPPOOL" Name="[APP_POOL_NAME]" ManagedPipelineMode="integrated"/>

    <!-- configure web site -->
    <iis:WebSite Id="WEBSITE" Description="[WEBSITE_NAME]" Directory="INSTALLFOLDER">

        <iis:WebAddress Id="AllUnassigned" Port="[PORT]"/>   

        <iis:WebVirtualDir Id="VIRTUALDIR" Alias="[VIRTUAL_APP_ALIAS]" Directory="API">
            <!-- configure virtual application -->
            <iis:WebApplication Id="APP" Name="[VIRTUAL_APP_NAME]" WebAppPool="APPPOOL" />
        </iis:WebVirtualDir>

        <!-- configure mime types -->
        <iis:MimeMap Id="MIME_JSON" Extension=".json" Type="application/json" />

    </iis:WebSite>                
</Component>   
Brad
  • 1,143
  • 9
  • 17
Adam Marshall
  • 3,010
  • 9
  • 42
  • 80

1 Answers1

-1

Putting MimeMap inside the WebVirtualDir tag should solve the issue.

Jeffrey Bosboom
  • 13,313
  • 16
  • 79
  • 92
Bobo K.
  • 101
  • 2