InvalidCastException in database constructor
Posted: Wed 19 Aug 2015 12:24
Hello,
I was given job to continue work on MySQL entity framework project and the project had working 8.3.363.6 (or something like that) dotConnect version. It has been a while since project was touched and trial on the connector had expired (exception was thrown) so I decided to update the connector since it had been informing me about the update for a while.
After I downloaded and re-installed the dotConnector for MySQL 8.4.464 I started to get this error message when code hits database (empty) constructor:
Error message it self is quite self explanatory, but I cannot underestand why project is using dll from C: drive (wrong version even) and then trying to convert it to version that is referenced to the project. I have not referenced the dll in windows folder.
Is this a problem with code? References? Expired trial?
I have put this provider in my app.config:
I was given job to continue work on MySQL entity framework project and the project had working 8.3.363.6 (or something like that) dotConnect version. It has been a while since project was touched and trial on the connector had expired (exception was thrown) so I decided to update the connector since it had been informing me about the update for a while.
After I downloaded and re-installed the dotConnector for MySQL 8.4.464 I started to get this error message when code hits database (empty) constructor:
Code: Select all
public DataStructureContext() : base("DB")
{
}
Code: Select all
[A]Devart.Data.MySql.Entity.Configuration.MySqlEntityProviderConfigurationSection cannot be cast to [B]Devart.Data.MySql.Entity.Configuration.MySqlEntityProviderConfigurationSection. Type A originates from 'Devart.Data.MySql.Entity, Version=8.4.464.0, Culture=neutral, PublicKeyToken=09af7300eec23701' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Devart.Data.MySql.Entity\v4.0_8.4.464.0__09af7300eec23701\Devart.Data.MySql.Entity.dll'. Type B originates from 'Devart.Data.MySql.Entity, Version=8.4.464.6, Culture=neutral, PublicKeyToken=09af7300eec23701' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Devart.Data.MySql.Entity\v4.0_8.4.464.6__09af7300eec23701\Devart.Data.MySql.Entity.dll'.
Is this a problem with code? References? Expired trial?
I have put this provider in my app.config:
Code: Select all
<providers>
<provider invariantName="Devart.Data.MySql" type="Devart.Data.MySql.Entity.MySqlEntityProviderServices, Devart.Data.MySql.Entity, Version=8.4.464.6, Culture=neutral, PublicKeyToken=09af7300eec23701" />
</providers>