I have a small command line app that uses the Oracle client (specifically, Oracle.DataAccess). I have version 2.11.7.20 installed on my development machine but the server the app will eventually run on has version 2.11.7.0. When I try to run the app on the server, it fails stating it can’t find the dll or one of its dependencies (the located assembly’s manifest definition does not match the assembly reference).
I copied the Oracle.DataAccess.dll from the server onto my machine, changed the project to reference it instead, and recompiled. It now runs properly on the server.
But, there must be a cleaner way of handling version problems like this, especially something as minor as x.x.x.0 to x.x.x.20. I have been developing in ASP.NET for years, where you can just alter the references to the assembly in web.config to sort out issues like this, but this is my first “desktop” application and have no idea what to do. I tried setting “Specific Version” to false under the properties in Visual Studio for the referenced assembly but it didn’t seem to do anything. I also tried adding an assemblyBinding to the app.config file but that caused the app to crash immediately.
<runtime>
<assemblyBinding>
<dependentAssembly>
<assemblyIdentity name="Oracle.DataAccess"
publicKeyToken="89b483f429c47342" />
<bindingRedirect oldVersion="2.111.7.20"
newVersion="2.111.7.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
EDIT: D’oh, I put the runtime section as the first block in app.config instead of after configSections. The app no longer crashes, but I still get the same error.
D’oh again. I left the xmlns off of the assemblyBinding; when I put it on, everything worked perfectly. So…you can use bindingRedirect to go backwards version-wise.