Question

I have a WCF Service that works just fine in the VS development server, but if I go to project settings and change the Web tab servers to use Local IIS Web Server instead I get a BadImageFormatException. I know that this is typically caused when a 32bit app references a 64bit dll. All of my assemblies are built for AnyCPU.

I don't really know what information would be helpful here, so please post a comment and I'll edit the question as needed.

For starters I'll say that I am using Autofac WCF integration (which again, this works in VS Dev server not IIS). I should also add that I checked IIS settings. Configured for DefaultAppPool which is set to .NET 4 Integrated pipeline. Anonymous authentication enabled, Windows disabled.

Here is a sample of my config file.

<system.serviceModel>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    <bindings>
      <basicHttpBinding>
        <binding name="Binding_basicHttp">
          <readerQuotas maxDepth="1000000000" maxStringContentLength="1000000000" maxArrayLength="1000000000" maxBytesPerRead="1000000000" maxNameTableCharCount="1000000000"/>
        </binding>
      </basicHttpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="ServiceBehavior_MetaAndDebug" name="Service1">
        <endpoint binding="basicHttpBinding" name="Service1Endpoint_basicHttp" contract="IService1">
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <endpoint address="/mex" binding="mexHttpBinding" bindingConfiguration="" name="Service1Endpoint_mex" contract="IMetadataExchange"/>
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost/Site/Service1/"/>
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehavior_MetaAndDebug">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top