This discussion is archived
3 Replies Latest reply: Dec 13, 2012 4:43 AM by Tridus RSS

lost - multiple ODP.NET versions, policy files...which version being used?

979561 Newbie
Currently Being Moderated
I've been using Oracle ODP.NET for a while without really understanding the policy files and how they determine what version is actually being used by the application. This target framework for this application 3.5. My machine has gone through some gyrations with installs of an Oracle Client, ODAC, ODT...

My development box is Windows 7 - on my start menu under Oracle I have these listed, along with some components that I got from the Oracle Universal Installer
* Oracle - Odac11g_home1 - ODAC for Oracle Client 11.1.0.6.21, ODP for .NET 2.0 11.1.0.6.20, Oracle Instant Client 11.1.0.6.0
* Oracle - Odac11g_home2 - ODAC for Oracle Client 11.1.0.7.20, ODP for .NET 2.0 11.1.0.7.20, Oracle Instant Client 11.1.0.7.0
* Oracle - OraClient11g_home1 - Oracle Client 11.2.0.1.0 containing ODP for .NET 11.2.0.1.0

On my C: drive I have these Oracle folders listed:
C:\Oracle\Ora11gR2\Base\Home\ODP.NET\bin\2.x
C:\Oracle\product\11.1.0\client_1\odp.net\bin\1.x\Oracle.DataAccess.dll
C:\Oracle\product\11.1.0\client_1\odp.net\bin\2.x\Oracle.DataAccess.dll
C:\Oracle\product\11.1.0\client_2\odp.net\bin\2.x\Oracle.DataAccess.dll

We have a VB.NET project which references an Oracle.DataAccess version (2.111.6.20) under assembly\GAC_32. Just to see what would happen, I deleted that reference, and attempted to re-add it - in References I clicked on the .NET tab, and the only Oracle.DataAccess item listed is for 2.111.7.20. I undid my checkouts to get back to where I was.

C:\Windows\assembly
* Oracle.DataAccess 1.111.6.20
* Oracle.DataAccess 2.111.7.20 x86
* Oracle.DataAccess 2.111.6.20 x86
* Oracle.DataAccess 2.112.1.0 AMD64

* Policy.1.102.Oracle.DataAccess 1.111.6.20
* Policy.1.111.Oracle.DataAccess 1.111.6.20
* Policy.10.1.Oracle.DataAccess 1.111.6.20
* Policy.10.2.Oracle.DataAccess 1.111.6.20
* Policy.2.102.Oracle.DataAccess 2.112.1.0
* Policy.2.111.Oracle.DataAccess 2.112.1.0
* Policy.9.2.Oracle.DataAccess 1.111.6.20

machine.config
System.data -- DbProviderFactories -- Oracle.DataAccess.Client Version=2.111.7.20

PATH - includes these in the order listed
C:\Oracle\product\11.1.0\client_2;
C:\Oracle\product\11.1.0\client_2\bin;
c:\oracle\ora11gr2\base\home\bin;
C:\Oracle\product\11.1.0\client_1;
C:\Oracle\product\11.1.0\client_1\bin;

regedit - find "ODP.NET"
-----------------------------------
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ODP.NET\2.112.1.0
• DllPath     c:\oracle\ora11gr2\base\home\bin

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx\ODP.Net
• (default)     C:\Oracle\product\11.1.0\client_2\ODP.NET\bin\2.x\

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ORACLE\ODP.NET
• Folder 1.111.6.20          DllPath C:\Oracle\product\11.1.0\client_1\bin
• Folder 2.111.6.20          DllPath C:\Oracle\product\11.1.0\client_1\bin
• Folder 2.111.7.20          DllPath C:\Oracle\product\11.1.0\client_2\bin


When I run my app with ODP.NET tracing on, the only clue I see to what version is being used is this in the trace file:
TIME:2012/12/11-12:55:35:614 TID:1880 (REGISTRY) (DllPath : C:\Oracle\product\11.1.0\client_1\bin)

Can anyone help me understand what all this means - what version of ODP.NET (Oracle.DataAccess) is being used and what determines that?

TIA.
  • 1. Re: lost - multiple ODP.NET versions, policy files...which version being used?
    gdarling - oracle Expert
    Currently Being Moderated
    The easiest way to determine what IS being used, is via Process Explorer .. http://sysinternals.com .

    What SHOULD be used is the version the app was compiled with, unless
    a) there's a Publisher Policy file in the gac redirecting to a newer version (which Oracle does put there, by default),
    or
    b) there's a binding redirect in your app.config which trumps the Policy file (if there is one) .


    To try to make sense of what is going on, we'd need to know
    a) what version the app was compiled with
    b) what policy files you have (which you seem to have provided)
    c) and for confirmation, what actually IS loaded, to confirm that it's doing what we expect, given a & b

    Generally you want to turn off "copy local" in the reference to avoid any additional confusion, as you generally want odp to be picked up from the GAC as a rule.

    Hope it helps,
    Greg
  • 2. Re: lost - multiple ODP.NET versions, policy files...which version being used?
    979561 Newbie
    Currently Being Moderated
    I have Process Explorer but investigating loaded dll's is new territory for me. This is a VS2008 solution, so once I bring up VS2008, "devenv.exe" appears in Process Explorer. The lower pane is displayed, and when I select "devenv.exe", the lower pane is populated with dll's - a LOT of them, but Oracle.DataAccess is not there yet. Then I bring up the solution, and again LOTS of dll's listed, but still no Oracle.DataAccess. Then I debug the solution...the first screen comes up, and in the lower pane this is one of the listed dll's:

    Oracle.DataAccess.dll Oracle.DataAccess.dll Oracle Corporation 2.111.6.20

    Does that prove that Oracle.DataAccess 2.111.6.20 is the version being loaded? That is the version that the project reference refers to - again, here is the project reference from that project:

    Oracle.DataAccess .NET 2.111.6.20 False C:\Windows\assembly\GAC_32\Oracle.DataAccess\2.111.6.20_morenumbers\Oracle.DataAccess.dll

    So I'm still not clear - what effect (if any) are the policy files having on the version of Oracle.DataAccess that gets loaded? As you can see from the Policy files I listed above, there is a Policy.2.111.Oracle.DataAccess which has version 2.112.1.0 - would that be used to redirect from 2.111.6.20 to the newer 2.112.1.0? Why is that not happening, so that 2.112.1.0 is the version being loaded?

    And I'm also not clear on how the Oracle.DataAccess version numbers map to the product versions. I've read the Oracle docs about that mapping but it's still not clear to me:
    1. would 2.111.6.20 mean Framework 2, 11.1.0.6.20? Where does the .0. come from?
    2. does that map to a specific version of Oracle?

    Thank you again for any info.

    EDIT: A coworker pointed out that the architecture of the policy files may be coming into play here - here are the policy files listed with architecture info:
    Policy.1.102.Oracle.DataAccess 1.111.6.20
    Policy.1.111.Oracle.DataAccess 1.111.6.20
    Policy.10.1.Oracle.DataAccess 1.111.6.20
    Policy.10.2.Oracle.DataAccess 1.111.6.20
    Policy.2.102.Oracle.DataAccess 2.112.1.0 AMD64
    Policy.2.111.Oracle.DataAccess 2.112.1.0 AMD64
    Policy.9.2.Oracle.DataAccess 1.111.6.20

    I don't know where the AMD64 files came from, but this project is targeted at "AnyCPU" and Framework 3.5, and runs on intel processors. So I'm guessing that the AMD64 is keeping the Policy.2.111.Oracle.DataAccess from being used. Am I right?

    Edited by: kicknwing123 on Dec 13, 2012 4:50 AM
  • 3. Re: lost - multiple ODP.NET versions, policy files...which version being used?
    Tridus Journeyer
    Currently Being Moderated
    kicknwing123 wrote:
    So I'm still not clear - what effect (if any) are the policy files having on the version of Oracle.DataAccess that gets loaded? As you can see from the Policy files I listed above, there is a Policy.2.111.Oracle.DataAccess which has version 2.112.1.0 - would that be used to redirect from 2.111.6.20 to the newer 2.112.1.0? Why is that not happening, so that 2.112.1.0 is the version being loaded?
    Normally it would, but it might not in this case since you actually have the exact target (2.111.6.20) on the machine. If you ran something linked to 2.111.6.20 but only had 2.112.1.0 installed, the policy would redirect it.

    I guess the initial question here would be why do you have so many clients installed?

Legend

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