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

**URL:** <https://community.cdata.com/t/the-type-initializer-for-xxxxxxx-xxx-threw-an-exception/353>\
**Category:** Editions\
**Tags:** article, ado.net, ef-core\
**Created:** [August 23, 2023, 2:29pm UTC](https://community.cdata.com/t/the-type-initializer-for-xxxxxxx-xxx-threw-an-exception/353 "2023-08-23T14:29:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Drin\_Karkini](https://avatars.discourse-cdn.com/v4/letter/d/e9bcb4/32.png) [@Drin\_Karkini](https://community.cdata.com/u/Drin_Karkini)\
**Post date:** [August 23, 2023, 2:29pm UTC](https://community.cdata.com/t/the-type-initializer-for-xxxxxxx-xxx-threw-an-exception/353/1 "2023-08-23T14:29:35Z")

</div>

The error message _“The type initializer for ‘xxxxxxx.xxx’ threw an exception”_ occurs in our [ADO.NET](http://ADO.NET) connectors when referencing an incorrect Dynamic-link library (DLL) in your project.

Typically, our [ADO.NET](http://ADO.NET) drivers are utilized in projects that use Entity Framework Core (EF Core). Our [ADO.NET](http://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](http://ADO.NET) Provider for Sybase IQ 2023 has been used as an example):

 ![fd95130a-b01d-43b3-a70c-5b1c2dbc963b.png](https://us1.discourse-cdn.com/cdata/original/2X/f/fcfd01b6bc4422bf2c05dc4a6c771367febfe4cf.png)

However, in the installation directories of our [ADO.NET](http://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](http://ADO.NET) Provider for SybaseIQ 2023\_

1. The first DLL is located at:

_C:\Program Files\CData\CData [ADO.NET](http://ADO.NET) Provider for SybaseIQ 2023\lib\System.Data.CData.SybaseIQ.dll_

 ![f29acf7f-d3ac-4371-b274-422929063d93.png](https://us1.discourse-cdn.com/cdata/original/1X/ba30a8f8b988c1be0975bfae615f3fb33efe42be.png)

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

C:\Users\\<User\>\Desktop\Drivers\ADO.NET\CData [ADO.NET](http://ADO.NET) Provider for SybaseIQ 2023\lib\netstandard2.0\System.Data.CData.SybaseIQ.dll

 ![fd06e568-612c-4d32-85ae-63dbe843ac5f.png](https://us1.discourse-cdn.com/cdata/original/1X/4cd37fbd5e371d6ffd59273e2399df04904e68a6.png)

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.’_

 ![fca51a62-03b7-4c28-b515-e0a8dda942e1.png](https://us1.discourse-cdn.com/cdata/original/1X/1938feb30db62b21e71cb87aa8a580d3c46005af.png)

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](http://ADO.NET) Provider for SybaseIQ 2023\lib\netstandard2.0\System.Data.CData.SybaseIQ.dll

Please reach out to [support@cdata.com](mailto:support@cdata.com) if this does not resolve the problem for you.
