The type initializer for 'xxxxxxx.xxx' threw an exception

  • 23 August 2023
  • 0 replies
  • 66 views

Badge

The error message "The type initializer for 'xxxxxxx.xxx' threw an exception" occurs in our ADO.NET connectors when referencing an incorrect Dynamic-link library (DLL) in your project. 

 

Typically, our ADO.NET drivers are utilized in projects that use Entity Framework Core (EF Core). Our ADO.NET drivers offer EF Core providers and to register these providers in a .NET project, you must reference the System.Data.CData.SybaseIQ.dll file as mentioned in our documentation (ADO.NET Provider for Sybase IQ 2023 has been used as an example): 

 

 

 

However, in the installation directories of our ADO.NET Providers, there are actually 2 System.Data.CData.SybaseIQ.dll files. The default installation folder in this case would be:  

C:\Program Files\CData\CData ADO.NET Provider for SybaseIQ 2023\ 

 

  1. The first DLL is located at: 

C:\Program Files\CData\CData ADO.NET Provider for SybaseIQ 2023\lib\System.Data.CData.SybaseIQ.dll 

 

 

  1. And the second DLL is in the following path: 

C:\Users\<User>\Desktop\Drivers\ADO.NET\CData ADO.NET Provider for SybaseIQ 2023\lib\netstandard2.0\System.Data.CData.SybaseIQ.dll 

 

 

 

If you try to reference the first one in your .NET project, you will receive the error we mentioned before: 

System.Data.CData.SybaseIQ.SybaseIQException: '[500] The type initializer for 'gyo230c.Kwj' threw an exception.' 

 

Make sure to reference the correct DLL in the specified path to avoid the issue: C:\Users\<User>\Desktop\Drivers\ADO.NET\CData ADO.NET Provider for SybaseIQ 2023\lib\netstandard2.0\System.Data.CData.SybaseIQ.dll

 

Please reach out to support@cdata.com if this does not resolve the problem for you.   


This topic has been closed for comments