0

I am getting the following error in one of my C# ASP.NET MVC applications:

The type initializer for 'Sybase.Data.AseClient1.AseConnection' threw an exception

Notice that it says AseClient1 and not AseClient, so I am not sure from where this 1 is coming from.

I have tried placing 32 bit and 64 bit version of both Sybase.AdoNet2.AseClient.dll and Sybase.AdoNet4.AseClient.dll in the bin directory of the application - but no luck.

The error is not appearing on my Dev machine where I can use both 32 bit and 64 bit versions of Sybase DLL and it works. I simply press F5 in Visual Studio 2013 and the application runs without any issues. The error only happens on another machine where the application is hosted on IIS.

Any idea how to fix this issue?

2
  • 1) Native dependencies should go to Windows directories (bitness matters). 2) “AseClient1” is a well known issue if you use a décompiler to analyze that assembly.
    – Lex Li
    Commented Jun 12 at 18:25
  • Which errors in eventvwr.msc > Windows Logs > Application? Commented Jun 24 at 15:05

1 Answer 1

0

You can try this method:

  1. On IIS, select aplications pools on left panel
  2. Select the aplication pool used on the website on the center panel
  3. Click on advanced Settings on the rigth panel
  4. On "Enable 32-Bit Applications" set the value to true
  5. Stop and start the aplication pool

Not the answer you're looking for? Browse other questions tagged or ask your own question.