This discussion is archived
12 Replies Latest reply: Mar 19, 2013 8:39 AM by 662798 RSS

Oracle.DataAccess.dll issue with windows 7 32 bit and .Net 4

946366 Newbie
Currently Being Moderated
Hello,

I will try to make it simple :

I have a .Net program that is using Oracle.DataAccess.dll (I mean, I really use classes that are specific to that dll, if I switch to .net System.Data.OracleClient, I cannot compile anymore).
This program is executing a Package on an oracle 10G database.

My development environment is a windows 7 64 bits.
The version of the DLL is *4.112.3.0* (the 32 bit one ( ODAC 11.2 Release 4 (11.2.0.3.0) the XCopy version (http://www.oracle.com/technetwork/database/windows/downloads/utilsoft-087491.html))
My program is targeting to x86 CPU (because the users here are running XP or 7 32 bits).

My program is working fine on my development machine.

Once I copy the exe and the dll on a windows 7 32 bits, I got an exception when opening the connection to the Database.

If I install the ODAC 11.2 Release 4 (11.2.0.3.0) with Oracle Developer Tools for Visual Studio on the machine, my program works fine !

The issue is : we don't want to install that client on all the computers in the company.
We want that the program works with the embedded DLL.

I tried to register the dll in the GAC (the GAC of the .net 4 located in C:\Windows\Microsoft.NET\assembly\GAC_32 -> not working

Do you have an idea ?
For me the program should have everything he needs with the Oracle.DataAccess.dll....

Thanks in advance !
  • 1. Re: Oracle.DataAccess.dll issue with windows 7 32 bit and .Net 4
    Alex_Keh - Oracle_Product_Manager Expert
    Currently Being Moderated
    What is the error number and message you see?

    Does the error occur when trying to load Oracle.DataAccess.dll or when trying to open the connection? You said opening a connection, but if the DLL was the problem, you would probably see an error before the Open call.

    When you xcopy, I assume you ran the batch file commands and didn't manually copy over the Oracle.DataAccess.dll only. Oracle.DataAccess.dll has a number of dependent DLLs that must be copied over as well. These commands should automatically GAC the DLL for you. When you say it's not working when you try to register the DLL, what error message do you see?
  • 2. Re: Oracle.DataAccess.dll issue with windows 7 32 bit and .Net 4
    946366 Newbie
    Currently Being Moderated
    Hello Alex :-)

    The error is the classical "object reference not set to an instance of an object".
    I used process explorer when starting my program I and saw the dll Oracle.DataAccess next to my program was loaded.
    I'm not sure it is the dll itself or the open() method that is causing the issue but I would say it is the open() method (I should probably create some traces out from the program, especially to know if there is an ORA error behind).

    In fact I didn't do the xcopy, I took the dll that I was interested in, use it in my program and I just deployed the program and that dll on the Client machine.
    I thought it was enough to just have that dll.
    Do you think it is possible to use these dependent dlls next to the program instead of deploying them into the GAC ?

    About the register of the dll in the gac, I used the exe that is next to the Oracle.DataAccess.dll in the folder ... net\4\bin. The utility was telling me the dll was registered. But know I'm not sure I was looking in the right GAC... :s
  • 3. Re: Oracle.DataAccess.dll issue with windows 7 32 bit and .Net 4
    Alex_Keh - Oracle_Product_Manager Expert
    Currently Being Moderated
    ODP.NET consists of more than Oracle.DataAccess.dll. You'll have to copy the dependent DLLs as well. It's certainly possible to do that with the GUI install version, but I wouldn't recommend it because the Xcopy version is intended to fulfill that niche. Developers that create their own customized installs with the smallest install size possible should use xcopy now. This should improve even more once the fully managed ODP.NET is released.

    With respect to the object reference error, it can point to many different possible solutions. It's possible that the connection object is null or getting disposed by the time you call Open(). You may want to post a code snippet of everything run up to that call.
  • 4. Re: Oracle.DataAccess.dll issue with windows 7 32 bit and .Net 4
    946366 Newbie
    Currently Being Moderated
    Hello Alex,

    Finally I did some tests with the xcopy.
    I used the install.bat first for .net 4 without the dependencies (instantclient). My program was not working.
    Then I install it with its dependencies and the program works fine.
    I watch with process explorer the loaded dlls and I could identify 3 of them :

    OraOps11w.dll
    oraociei11.dll (127 mb !)
    oci.dll

    Then I uninstall everything and I copied the 3 dlls next to my program, so in total I have 4 dlls (including oracle.dataaccess.dll).
    The program works perfectly!

    So it is exactly what I currently need, without installing anything else I can start my program.

    Thanks for the help,

    Regards,
  • 5. Re: Oracle.DataAccess.dll issue with windows 7 32 bit and .Net 4
    963110 Newbie
    Currently Being Moderated
    I did just this and got my program up and running.
    NOW, I am getting told that it is not "legal" to do it this way. ALL of the ODAC dlls must be published in the executable folder.
  • 6. Re: Oracle.DataAccess.dll issue with windows 7 32 bit and .Net 4
    fscherie Newbie
    Currently Being Moderated
    Hi,

    I think what you meant is "unsupported". unsupported describes a scenario where an installation does not follow the steps descibed in readme / installation guide to the product - for example removing DLL's which seems to be not used etc.

    Often customers want to do that - and thats the reason Oracle introduced a minimal configuration called instant clients.
    This instant client is bundled with the MS API's like ODP.NET - and you can decide during install - for example when using XCOPY deployment - only to setup a minimal config - for example - Instant client + ODBC - avoiding OLEDB, ODP.NE etc.
    Anyway - this is the way to get the minimal supported configuration - everything else is unsupported and a bug can only be logged if the issue is reproducable in a correctly configured environment.

    But even the Instant Client is to large for some customers so Oracle developed a Managed Provider which consist only of ONE DLL - size ~ 6 MB. In opposite to the unmanaged Provider it does not use the OCI DLLs which call the Oracle Network funtions from big ~ 100MB oraociei11.dll - it implements all the stuff itself using C#.
    Comparing managed provider with unmanaged provider is like JDBC/Thin with JDBC/OCI.

    If you want to give the Beta Managed Provider 11.2.0.3.50 a chance - look here:

    http://www.oracle.com/technetwork/database/windows/downloads/odpmbeta-1696432.html?ssSourceSiteId=otncn

    next patch 11.2.0.4 and upcoming 12.1 will ship managed provider as ready-to-use product and when using "alias-less" connection you dont even need a tnsnames.ora or sqlnet.ora.

    I hope one file 6MB is less enough ;-)

    Frank

    Edited by: fscherie on 07.11.2012 15:51
  • 7. Re: Oracle.DataAccess.dll issue with windows 7 32 bit and .Net 4
    963110 Newbie
    Currently Being Moderated
    Just moved over to the Oracle.ManagedDataAccess.dll (requires .NET 4) and it works great!
    Happy Camper!
  • 8. Re: Oracle.DataAccess.dll issue with windows 7 32 bit and .Net 4
    946366 Newbie
    Currently Being Moderated
    Hi fscherie,

    Interesting link, I'll try it when I can :)
  • 9. Re: Oracle.DataAccess.dll issue with windows 7 32 bit and .Net 4
    662798 Newbie
    Currently Being Moderated
    Isn't that still in BETA?

    Would you trust that in a production environment?
  • 10. Re: Oracle.DataAccess.dll issue with windows 7 32 bit and .Net 4
    662798 Newbie
    Currently Being Moderated
    The problem with this approach is that you are producing a bloated application carrying around 100 MB or so of extra baggage IMHO. But I think this is fine for some scenarios, like standalone windows or wpf apps.
  • 11. Re: Oracle.DataAccess.dll issue with windows 7 32 bit and .Net 4
    Tridus Journeyer
    Currently Being Moderated
    imterpsfan2 wrote:
    Isn't that still in BETA?

    Would you trust that in a production environment?
    Personally... it depends. We have one application in my shop using it right now in production because the alternative was a total logistical nightmare. We did a boatload of testing on it and in that specific application, beta or not it worked perfectly for what we need. Nothing else has used it outside of experimental purposes though, and we're holding off on other applications.

    Normally it's not a great idea, but sometimes it's still better than the alternatives. It depends on the situation, the users, how easy it is to push updates out, etc.
  • 12. Re: Oracle.DataAccess.dll issue with windows 7 32 bit and .Net 4
    662798 Newbie
    Currently Being Moderated
    I'm looking forward to using it myself, but I want to wait until the final release is out. We have a support contract with Oracle support and I would have some concerns about them supporting a BETA product if a crisis occurred.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points