Search code examples
c#sap-ase

Build number Mismatch : Problem with Sybase ASE version


I have a C# Console application which references Sybase.Data.AseClient.

  • dev machine has version 1.15.325 version of dll
  • UAT has version 1.12.XYXZ
  • Prod has version 1.15.115

I get the below exception on a machine similar to prod


ERROR 2010-11-11 18:18:23,562 15546ms FxSpotRateServer Main - Error System.TypeInitializationException: The type initializer for 'Sybase.Data.AseClient.AseConnection' threw an exception. ---> Sybase.Data.AseClient.AseException: Build number Mismatch - sybdrvado115a.dll. Expecting build number greater than or equal to '325'. Loaded build number 152. at Sybase.Data.AseClient.AseConnection.CheckVersion() at Sybase.Data.AseClient.AseConnection..cctor() --- End of inner exception stack trace --- at Sybase.Data.AseClient.AseConnection..ctor(String connectionString) at Applicationname.ClassName.GetAseConnectionString(String connectionString) in -------------------------------------------------------------------------------------------

I am thinking of doing having a runtime binding configured in my app.config and do this redirection on runtime.

Is there some other way/patterns to dynamically plug in these versions?
Is my approach clean and suggested?


Solution

  • This is not a problem you can fix with a .config file. It is finding an old version of the unmanaged code that actually does the heavy lifting. The name is in the error message, sybdrvado115a.dll. I'd look in c:\windows\system32 first.

    You are going to have to update the Sybase provider on that machine to get past this exception. Or find an old version of the managed wrapper somewhere. Upgrading, and getting all machines up to date, is definitely the better solution.