BadImageFormatException. This will occur when running in 64 bit mode with the 32 bit Oracle client components installed

后端 未结 21 2511
南方客
南方客 2020-11-21 13:30

I am getting this error while on of my .Net application are trying to make a connection to oracle database.

The error says that This problem will

21条回答
  •  执笔经年
    2020-11-21 13:51

    BadImageFormatException occures when a 32bit (x86) dll calls a 64bit dll or vice versa. If using AnyCPU for your entry executable then when run on a 64bit machine it will run as 64bit, however if that then calls a 32bit dll you get the exception which is why AnyCPU isn't always the answer.

    I tend to build everything as 32bit (x86) as we still have to interface with some old components done in VB6 (32bit (x86)). While performance might be better for 64bit machines if we where to build in AnyCPU reliability is more important for us.

    I would suggest trying to build all you components in 32bit (x86), unless you are doing some really intensive stuff I doubt it will make much difference.

提交回复
热议问题