Failed to load version of Oracle.DataAccess.

I'm having problems with Oracle.DataAccessv WPF. I used Oracle.DataAccess v4.0 without a problem. But now it is updated to version 4.112, and when I add a link to this version in WPF, the constructor cannot be loaded. This gives me the following error:

System.BadImageFormatException
Could not load file or assembly 'Oracle.DataAccess, 
Version=4.112.3.0, Culture=neutral, 
PublicKeyToken=89b483f429c47342' or one of its dependencies. 
An attempt was made to load a program with an incorrect format.

Please note that the program works without problems. I read that this may be due to the "target processor" in the properties. I tested both x64 and x86, but nothing changes. How can I solve this problem. thanks in advance

+5
source share
4 answers

Oracle.DataAccess.dll. ODAC 11 XCopy Oracle.DataAccess.dll \odp.net4\odp.net\bin\4 OracleClient\odp.net\bin\4 dll. .

, - .

+6

, , DLL Oracle.DataAcces. .NET- Oracle 11?

, .

+3

. PowerShell, .

$target = "\\SERVER\c$\PROJECT"
$oracleBin = "C:\oracle\product\11.2.0\client_1\BIN\"
$projectHome = "C:\Users\USER\Code\CSharp\PROJECT\bin\Release\"
$files = @(
($oracleBin + "oci.dll"),
($oracleBin + "orannzsbb11.dll"),
($oracleBin + "oraocci11.dll"),
($oracleBin + "OraOps11w.dll"),
($projectHome + "EntityFramework.dll"),
($projectHome + "EntityFramework.xml"),
($projectHome + "Oracle.DataAccess.dll"),
($projectHome + "PROJECT.exe")
#,($projectHome + "PROJECT.exe.config")
)
foreach($f in $files) {
    copy-item $f $target
}

, -, :

  • Oracle (, _1\bin), , Oracle.DataAccess.dll Visual Studio. Oracle, , .
  • Oracle 11g. Oracle 12c, , , * 11.dll * 12.dll.

enter image description here

0

Another solution is to download and run the install.bat file in 'ODAC112030Xcopy.zip' from Downloading 64-bit Oracle Data Access Components (ODAC) .

0
source

All Articles