Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format

后端 未结 10 1287
轮回少年
轮回少年 2021-01-31 11:49

I have installed a Web app on IIS 7.0 Windows Server 2008 R2 64bit. I am referring an oracle.DataAccess.dll; When I try to access the application I get the following message: \"

相关标签:
10条回答
  • 2021-01-31 12:22

    I had the same problem.

    I go to the project properties in general section set platform target to 64 bit (x64) and my problem solved

    0 讨论(0)
  • 2021-01-31 12:27

    You need to register that dll on the live server using GAC util. Also check if its present in bin folder or not. Some times missing dll's in bin directory results in same error

    0 讨论(0)
  • 2021-01-31 12:29

    Installing 64-bit ODAC 11.2 Release 3 (11.2.0.2.1) Xcopy for Windows x64 from:

    http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html

    Fixed it for me. Make sure to update your system path as per step #4 in the readme file.

    0 讨论(0)
  • 2021-01-31 12:36

    It seems the Oracle Data Access Component installation process using the "11.2 Release 3 (11.2.0.2.1) with Xcopy Deployment" version is broken. To fix this you must register the missing assemblies in the GAC. To do this for this specific version run these commands from within an administrator console:

    md C:\Windows\assembly\GAC_32\Oracle.DataAccess\4.112.2.0__89b483f429c47342\
    
    copy %ORACLE_HOME%\odp.net\bin\4\Oracle.DataAccess.dll C:\Windows\assembly\GAC_32\Oracle.DataAccess\4.112.2.0__89b483f429c47342\
    
    md C:\Windows\assembly\GAC_32\Oracle.Web\4.112.2.0__89b483f429c47342\
    
    copy %ORACLE_HOME%\asp.net\bin\4\oracle.web.dll C:\Windows\assembly\GAC_32\Oracle.Web\4.112.2.0__89b483f429c47342\
    

    Note that this registers only the DLL's but not other languages resources. So, if you are using any another language than English (de, es, fr, it, ja, ko, pt-BR, zh-CHS, and zh-CHT), then you need to register these as well using the corresponding resource file.

    If you have Visual Studio installed on the machine, you can issue the following commands instead:

    gacutil /i %ORACLE_HOME%\odp.net\bin\4\Oracle.DataAccess.dll
    gacutil /i %ORACLE_HOME%\asp.net\bin\4\oracle.web.dll
    

    Note: look for gacutil.exe under the Visual Studio installation folder for it.

    Hope this helps.

    P.S. Or you can try this.

    0 讨论(0)
提交回复
热议问题