IIS Web Site loads 32-bit Oracle data access when 64-bit is called for: why?

0

I have a Classic ASP Web Site project from Visual Studio 2005. I'm migrating it to Visual Studio 2017 and .NET 4.0 with ASP.NET. Everything is working except for my access to the Oracle data components.

Please note that this is a Web Site project, not a Web Application project, because of an unusual client requirement to be able change code, on occasion, on deployed servers. Among other things, that means there is no actual .csproj file with settings in it.

When my code attempts to load the Oracle.DataAccess assembly, this error occurs:

An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

and farther on down:

BadImageFormatException: An attempt was made to load a program with an incorrect format.

and further

InvalidOperationException: Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.

I checked the relevant application pool in IIS 10 and it's definitely not allowing 32-bit applications. So I know this web site project is running in 64-bit mode.

My web.config contains this section:

<system.web>
  <compilation debug="true" targetFramework="4.0">
    <assemblies>
      <add assembly="Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89B483F429C47342"/>
    </assemblies>
  </compilation>
</system.web>

I've loaded the Oracle odp.net.x64 nuGet package. I even ran CORFLAGS.EXE on Oracle.DataAccess.DLL in my packages folder to verify that it is indeed a 64-bit DLL. Same for the copy in my site's bin folder.

To minimize any complications from deployment, I set the application's "physical path" on IIS to point to my code in situ where it's being developed.

So now I'm at a loss. It seems that the only relevant copy of the Oracle.DataAccess assembly is a 64-bit one, but IIS is picking up a 32-bit version of it somehow and raising the exception. Therefore, my question is: what is going on that's causing IIS to try to load a 32-bit version of Oracle.DataAccess?

asp.net
iis
oracleclient
asked on Stack Overflow Jan 9, 2018 by catfood

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0