1
votes

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()

1
Check, if your program is 32-bit (since you are trying to load 32-bit assembly) - Dmitry Bychenko
I have tried with both 32 bit and 64 bit program, but getting the same error. - kanika

1 Answers

0
votes

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.