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 1319
轮回少年
轮回少年 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:10

    In my case, I use VS 2010, Oracle v11 64 bits. I might to publish in 64 bit mode (Setting to "Any Cpu" mode in Web Project configuration) and I might set IIS on Production Server to 32 Bit compability to false (because the the server is 64 bit and I like to take advantage it).

    Then to solve the problem "Could not load file or assembly 'Oracle.DataAccess'" (sometime appear the "Compiler Error Message: CS1705: Assembly" error):

    • In the Local PC and Server is installed Oracle v11, 64 Bit.
    • In all Local Dev PC I reference to Oracle.DataAccess.dll (C:\app\user\product\11.2.0\client_1\odp.net\bin\4) which is 64 bit.
    • In IIS Production Server, I set 32 bit compatibility to False.
    • The reference in the web project at System.Web.Mvc.dll was the version v3.0.0.1 in the local PC, however in Production is only instaled MVC version 3.0.0.0. So, the fix was locallly work with MVC 3.0.0.0 and not 3.0.0.1 and publish again on server, and it works.

提交回复
热议问题