1

I have Windows 10 machine. In that I am running a c# project which references Oracle.DataAccess.dll. I have installed ODAC112012_32Bit. There is a dll NexFen.FirmLoad which accesses Oracle dll. When I run the project I get following error:

System.TypeInitializationException: The type initializer for 'NexGen.FirmLoad.AppUtils' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ---> System.IO.FileLoadException: Could not load file or assembly 'Oracle.DataAccess, Version=4.112.1.2, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) --- End of inner exception stack trace --- at NexGen.FirmLoad.AppUtils..cctor()
--- End of inner exception stack trace --- at NexGen.FirmLoad.LoadFirmware.d__0.MoveNext()

Dmitry Bychenko
  • 180,369
  • 20
  • 160
  • 215
kanika
  • 92
  • 1
  • 13

1 Answers1

0

Check that your project meets all the following conditions:

  • You have an Oracle client installed (e.g. Oracle Instant Client)
  • Oracle.DataAccess.dll and the Oracle Client and the compile target of your application have all the same architecture (i.e. 32-bit vs. 64-bit)
  • Version of Oracle.DataAccess.dll is the same version as your Oracle client (even the minor version has to match). Your error message indicates version 4.112.3.0 and 4.112.1.2, perhaps there is your problem. Check installed versions in your GAC and Policies.
Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110
  • I have checked installed version in GAC. In GAC-32 it's 4.112.1.2 and in GAC-64 it was 4.112.3.0 which I have uninstalled as my project was referring to 4.112.1.2 version so. – kanika Apr 10 '18 at 06:26
  • @kanika, in case you like to use 32-bit and 64-bit have a look at this solution: https://stackoverflow.com/questions/24104210/badimageformatexception-this-will-occur-when-running-in-64-bit-mode-with-the-32#24120100 – Wernfried Domscheit Apr 10 '18 at 07:12