locked
Oracle DataAccess Error - Could no load file or assembly 'Oracle.DataAccess' or one of it's dependencies. RRS feed

  • Question

  • User-373571878 posted

    Hello,

    I upgraded a VS 2008 32bit application to VS 2012 on a 64 bit laptop.

    I installed the 32bit ODAC on the 64bit laptop so that the versions would match that of the server.

    When I go to run the program locally on the new laptop I get the error.

    I see that one of the fixes is to enable 32bit applications via IIS?  But this is my local machine, where do I go to enable it?

    Friday, May 20, 2016 3:33 PM

Answers

  • User269602965 posted

    The oracle unmanaged driver is explicitly 32-bit or 64-bit.

    In a mixed environment you can establish an Oracle Base directory, like C:\ORABASE

    Then you can installed the 12cR5 32-bit ODP.NET client in one Oracle Home like C:\ORABASE\DB12CR5_CLIENT32

    Then you can install the 12cR5 64-bit ODP.NET Client in another home like C:\ORABASE\DB12CR5_CLIENT64

    Then you can run either 32-bit or 64-bit applications on the 64-bit OS.

    Of course, you have to use the correct ODAC.DLL (bitness and ver of .NET must match.

    Which is why I put the required ODAC.DLL in the /BIN folder of my application and make a local reference.

    If you compile 32-bit app you must use the 32-bit ODAC

    If you compile 64-bit app you must use the 64-bit ODAC

    The web.config and app.config settings are the same whether you use 32-bit or 64-bit unmanaged driver.

    ++++++++++++++

    If you use the MANAGED ODP.NET driver, then it auto detects 32-bit and 64-bit and you can compile either way.

    But the managed driver has a few limitations

    1. it is new so does not yet support ALL ODP.NET functionality, but what is missing is the more exotic features not in main use.

    2. it does not work in FIPS-140 enabled app server UNLESS you are using Oracle 12C database

    3. the web config app config set up is different (you must read oracle documents), and the imports/using statements are different.

    I have 64-bit server and I am running 32-bit unmanaged driver apps, 64-bit unmanaged driver apps, and the managed driver apps..

    all on the same app server.

    but you have to understand how all these work and how to set them up properly.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 20, 2016 11:54 PM

All replies

  • User269602965 posted

    Complete the 64-bit migration.

    1. install the 64-bit Oracle Unmanaged Driver ODP.NET CLIENT into a new Oracle Home directory

    2. take the correct Oracle ODAC.dll (there are .NET 4.00 and .NET 2.0/3.5 versions) and put in your application /BIN directory

    3. make local reference to the Oracle ODAC.dll

    4. recompile app as 64-bit

    Friday, May 20, 2016 5:23 PM
  • User-373571878 posted

    Thanks Lannie, so there is no way of keeping it as 32 bit?

    The reason I ask is, I have VS 2012 installed on a laptop that is Windows 7 (32bit) and my other laptop has VS 2012 installed but this is a 64bit Windows 8 machine.

    I was hoping that I could make a change to the application using either laptop.  If I set up for 64bit, then won't that change the web.config file assemblies?

    The web site currently works on my laptop Windows 7 and on our web server Windows 2012 R2, It's just on the Windows 8 laptop that it does not.

    Is there a switch anywhere locally that it would accept 32 bit applications, like there is in IIS.  Plus 32 bit applications should run on a 64 bit machines, isn't that so?

    Friday, May 20, 2016 5:35 PM
  • User269602965 posted

    The oracle unmanaged driver is explicitly 32-bit or 64-bit.

    In a mixed environment you can establish an Oracle Base directory, like C:\ORABASE

    Then you can installed the 12cR5 32-bit ODP.NET client in one Oracle Home like C:\ORABASE\DB12CR5_CLIENT32

    Then you can install the 12cR5 64-bit ODP.NET Client in another home like C:\ORABASE\DB12CR5_CLIENT64

    Then you can run either 32-bit or 64-bit applications on the 64-bit OS.

    Of course, you have to use the correct ODAC.DLL (bitness and ver of .NET must match.

    Which is why I put the required ODAC.DLL in the /BIN folder of my application and make a local reference.

    If you compile 32-bit app you must use the 32-bit ODAC

    If you compile 64-bit app you must use the 64-bit ODAC

    The web.config and app.config settings are the same whether you use 32-bit or 64-bit unmanaged driver.

    ++++++++++++++

    If you use the MANAGED ODP.NET driver, then it auto detects 32-bit and 64-bit and you can compile either way.

    But the managed driver has a few limitations

    1. it is new so does not yet support ALL ODP.NET functionality, but what is missing is the more exotic features not in main use.

    2. it does not work in FIPS-140 enabled app server UNLESS you are using Oracle 12C database

    3. the web config app config set up is different (you must read oracle documents), and the imports/using statements are different.

    I have 64-bit server and I am running 32-bit unmanaged driver apps, 64-bit unmanaged driver apps, and the managed driver apps..

    all on the same app server.

    but you have to understand how all these work and how to set them up properly.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 20, 2016 11:54 PM
  • User-373571878 posted

    Thanks Lannie.

    Oracle seems to be a tangled web for those who are not versed in it (at least for me). Even if you are it seems it is overly complicated. Thanks for the information!

    I hate to keep messing with it since it is working on the main server and my one laptop.

    But It seems that may be the only way to get all devices firing together.

    Monday, May 23, 2016 3:18 PM
  • User269602965 posted

    I do not find it any more of a pain than MSSQL, MYSQL, MSACCESS, DB2...

    with all of them, you have to use specific drivers for specific instances of environment.

    The new MANAGED driver is a good step for simplicity once you figure out the CONFIG settings as the client is installed in the driver, works 32-bit or 64-bit

    for all the standard relational database operations of select, update, insert, delete, and transactions.

    But if your environment demands FIPS-140 enabled in security options, then managed driver has issues.. I heard fixed in the Oracle 12c Database... but many are still using Oracle 10 and 11g.

    Monday, May 23, 2016 7:09 PM