Oracle Version Error

Filed under: Programming — ej2 at 10:18 am on Tuesday, November 17, 2009

Last night, I struggled with the following error for a few hours:

Could not load file or assembly ‘Oracle.DataAccess, Version=2.111.7.20, Culture=neutral, PublicKeyToken=89b483f429c47342′ or one of its dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly ‘Oracle.DataAccess, Version=2.111.7.20, Culture=neutral, PublicKeyToken=89b483f429c47342′ or one of its dependencies. The system cannot find the file specified.

Development Machine Setup:
Windows 7 64 bit
Oracle 11g Release 1 (11.1.0.7.0)

Target Machine Setup:
Windows XP 32 bit
Originally Oracle 10g, now Oracle 11g (11.1.0.6.0)

After many grueling hours of searching the darkest corners of the internet, I found this post: ODP.NET & LLBLGen Pro. The author suggests using a binding redirect to fix a problem with LLBLGen Pro (but same basic error). While I am not exactly sure what is causing my problem, adding a binding redirect fixed it. The solution seems silly. I install Oracle 11g release 1 (11.1.0.7.0), which is what it is asking for and it still cannot be found.
I install Oracle 11g (11.1.0.6.0) and add the binding redirect and it works.

Here is my config:

<assemblyBinding xmlns=”urn:schemas-microsoft-com:asm.v1″>
<dependentAssembly>
<assemblyIdentity name=”Oracle.DataAccess” publicKeyToken=”89B483F429C47342″/>
<bindingRedirect oldVersion=”2.111.7.20″ newVersion=”2.111.6.0″/>
</dependentAssembly>
</assemblyBinding>

Note: Assembly redirection can work both ways. You can re-direct calls to a new version of the to an older installed version and vice-versa. You can read more about Binding Redirects on MSDN.

I hope this post can save someone a few headaches.

Database Normalization explained

3 Comments »

931

Comment by Ric

November 17, 2009 @ 8:12 pm

WHAT?!?!?!?!?!?!?!

932

Comment by Frans Bouma

November 18, 2009 @ 7:45 am

The problem is caused by the fact that the ODP.NET driver and DQE are build against 10g’s 10.2.0 odp.net (assembly version 2.102.2.20 )Newer builds of ODP.NET install a policy file in the GAC which includes this assembly redirect from any version (2.102.0.0) to the version of the ODP.NET assembly installed, e.g. 2.111.7.20)

If such a redirect / policy file isn’t installed by ODP.net (which sometimes happens with ODP.NET patches released by oracle, as these sometimes don’t contain a policy file), the CLR will look for 2.102.2.20, which isn’t found. You then have to specify the redirect manually, in the config file of your application and the llblgenpro.exe.config file.

What’s odd in your situation is that you had to redirect to an OLDER version, which suggests that 11.1.0.7 apparently didn’t install a policy file in the GAC, but 0.6 did.

(ps, please post these kind of questions on our forums, we might have shortened the long struggle for you, also more people have ran into this so you could have found the answer on our forums through its search. Just a FYI ;) )

935

Comment by Chuck

December 16, 2009 @ 12:48 pm

Same issue with C# windows client

Just changed the debug target in the config manager from “Any CPU” to “x86″ and issue is gone.

ARGH!

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Comment spam protected by SpamBam