Pages

Monday, December 13, 2010

web.config driver dll change for the x64 or x86

Issue: An attempt was made to load a program with an incorrect format 64 bit

Add the following binding policy:

Code Snippet
    <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89b483f429c47342" />
        <bindingRedirect oldVersion="2.0.0.0-10.9.9.9" newVersion="2.102.3.2" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
If you want your application to force using 64-bit client when running in 64-bit more (tested on AMD 64) use the following code in app.config of your file:
 
Code Snippet

    <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89b483f429c47342" processorArchitecture="amd64" />
        <bindingRedirect oldVersion="2.0.0.0-10.9.9.9" newVersion="2.102.3.2" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
   
processorArchitecture and bindingRedirect can work wonders for you... changing the redirections and processorArchitecture will help u eliminate the badImageException.

No comments:

Post a Comment