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 1318
轮回少年
轮回少年 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:17

    The accepted answer, published by George Netu helped to solve my problem, but I had to fiddle with some additional trifles:

    Problem description:

    Under C:\Windows\assembly, I found two Oracle.DataAccess items(GAC-folders?). Relict, caused by several Oracle client installations. One item showed Version 2.112.1.0 but was actually version 2.121.2.0 (visible through Properties->Version). That inconsistency was the bug.

    First unhelpful attempts:

    • tried to deinstall and reinstall the Oracle full client, both in versions Runtime/Administrator
    • tried to redeploy the correct .dlls
    • tried to copy the new installed assemblies in the GAC serveral times, as stated in the accepted answer above via command prompt (but that didn't solve the version mismatch..)
    • tried to use gacutil /i ...

    Final success:

    I landed on the Gacutil.exe msdn page and were ultimately able to delete the items from the C:\Windows\assembly folder.

    gacutil /u Oracle.DataAccess, Version=2.112.1.0, Culture="Neutral",PublicKeyToken=45e343aae32233ca
    gacutil /u Oracle.DataAccess, Version=2.212.2.0, Culture="Neutral",PublicKeyToken=45e343aae3223abc
    gacutil /u Oracle.Web, Version=2.112.1.0, Culture="Neutral",PublicKeyToken=45e343aae3223def
    

    After that, i repeated the two gacutil /i ... commands and the two dlls appeared there in consistent versions.

    Finally restarted the IIS, and it works..

提交回复
热议问题