Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Assembly BindingRedirect with a .NET application

2788723Nov 5 2014 — edited Dec 2 2014

Hello everyone,

I'm facing an issue with a VB.Net application that I develop. This application has a reference to Oracle.DataAccess assembly to communicate with an Oracle database.

I developed this application with a reference to the assembly version 2.112.3.0, but the computer where I install my application has an Oracle client version 2.112.1.0.

Obviously, when I execute my application on the other computer, it crashes and says :

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

I made some research and found that it could be possible to bypass this issue with the binding redirect mechanism of .NET.

I tried to add this section in the app.config file of my application :

<configuration>

   <runtime>

      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

         <dependentAssembly>

            <assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />

            <bindingRedirect oldVersion="0.0.0.0-2.112.3.0" newVersion="2.112.1.0"/>

         </dependentAssembly>

      </assemblyBinding>

   </runtime>

</configuration>

But it didn't changed anything. Maybe I made a mistake in it.

I even don't know if this information is compiled with my application or if I have to deploy explicitly the app.config file with my setup.

What I want to do is to make able my application to work with a client 2.112.1.0 even if I develop with a 2.112.3.0.

Is it possible ?

Is it a good option to work in this way or is it better to work everywhere on 2.112.3.0 ? If I have to go this way, it involves a lot of installations of the new Oracle client for the customer.

Also, I have 4 applications that work with Oracle, so I have to make the modification everywhere at the same time ?

Thanks in advance.

Regards,

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 30 2014
Added on Nov 5 2014
2 comments
2,851 views