1

I could not find a specific answer for my scenario hence posting this question once again in the board. Apologies if it is already answered.

Following is my scenario/problem:
We have a windows forms application and several business logic and data tier assemblies. Our application uses Oracle database. We have several assemblies in our project that refers to the Oracle.DataAccess.dll assembly. When we try to upgrade to a newer version of oracle, how do we specify the assembly redirect for all the assemblies dependent on Oracle.DataAccess.dll?

We can provide the assembly redirect tags in app.config that comes with the application, but does it provide redirection for all the assemblies in that application?

To give an example:

I have an exe "Shell.exe" and two assemblies DataTier1.dll and DataTier2.dll refering to the Oracle.DataAccess.dll. All the assemblies will be deployed into same location. How do we specify that DataTier1.dll and DataTier2.dll should be redirected to specific version of Oracle.DataAccess.dll?

would it be enough if we just provide the assembly.redirect tags in the Shell.exe.config and it will take care of all of the assemblies deployed in that directory?

edit : @JennyO'Reilly : You are right. I know about the assembly redirection part. I just want to confirm if adding this to just one .exe.config will suffice for all the assemblies in that application.
To give more background on this, we have 2 versions of our application.
V1 supports Oracle 11g and V2 supports Oracle 12c.
We would be installing both Oracle 11g and Oracle 12c side by side on our machines.
In V1, though we have reference to Oracle 11 odp.net, if 12c is also available, it is picking up the 12c version odp.
we want to make sure that V1 always connects to oracle 11 assemblies irrespective of any other versions available in the machine. We need assembly redirection for V1 to bind to oracle11 explicitly.

Please let me know if this scenario is clear enough.

Thanks,
Satish

Satish
  • 445
  • 2
  • 4
  • 15
  • Have you tried using "PublicKeyToken" attribute properly. Would you please share your configuration if you have used this for assembly redirection? – Rahul Ranjan Feb 17 '15 at 10:12
  • Why don't you just try your own suggestion? – Krisztián Balla Feb 17 '15 at 11:14
  • Remove the Oracle.DataAccess.dll assembly reference from the project(s) that use it. And add it back, now selecting the new version. Rebuild. If you don't want to do that then there is a *lot* of documentation available for the `` element in the Shell.exe.config file you need. No point in repeating it here. – Hans Passant Feb 17 '15 at 11:14
  • @HansPassant: I think he is aware of all that. He wants to know if adding the bindigRedirect also affects the libraries used within the project. – Krisztián Balla Feb 17 '15 at 11:19
  • Why not just rebuild against the newer version of the Oracle assembly? If you are using NuGet or referencing external dlls from a common location it should be easy to rebuild your entire project with the updated assemblies - redirects are normally used when a rebuild is not possible for some reason. – Justin Feb 17 '15 at 11:21

0 Answers0