unable to load Sybase.AdoNet4.AseClient in .net 4.0 website

1.7k views Asked by At
Unable to connect to database. xxx.db.ConnectionException: DBServer::GetConnection: mscorlib: Could not load file or assembly 'Sybase.AdoNet4.AseClient, Version=4.157.1300.0, Culture=neutral' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040): at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at

I am getting the above error when I use the new 64 bit dll in bin folder. Can you please suggest from stack trace what could be the error?

1

There are 1 answers

0
Brian Gilreath On

The most important message in the stack trace is the line: The located assembly's manifest definition does not match the assembly reference. This indicates that the problem is likely mismatched assembly references. You should do the following to resolve this problem:

  1. Delete the assembly that you dropped directly into the /bin folder and any pdb's if added. Also make sure to remove the old .dll if it is anywhere nested within the /bin folder in a sub directory.
  2. In VS, add this assembly as a reference and re-compile.
  3. If this does not resolve your issue, also check your web.config or machine.config to see if there are any reference that may have the old version information .