Mutiple version of Devert

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
sabbir
Posts: 17
Joined: Tue 02 Dec 2014 09:45

Mutiple version of Devert

Post by sabbir » Tue 02 Dec 2014 09:58

i am building a web service where the version of Devart.Data.MySql is 7.2.77.0(install in my local machine).The version of Devart.Data.MySql in my server is 6.60.258.0.So when i build the web service locally and publish it in webserver i am getting the error '[A]Devart.Data.MySql.MySqlConnection cannot be cast to Devart.Data.MySql.MySqlConnection. Type A originates from 'Devart.Data.MySql, Version=6.60.258.0, Culture=neutral, PublicKeyToken=09af7300eec23701' in the context 'Default' at location 'C:\Windows\assembly\GAC_MSIL\Devart.Data.MySql\6.60.258.0__09af7300eec23701\Devart.Data.MySql.dll'. Type B originates from 'Devart.Data.MySql, Version=7.2.77.0, Culture=neutral, PublicKeyToken=09af7300eec23701' in the context 'Default' at location 'C:\WebServer\nVision.LIVE\nVision.DataPort.Service\Application Files\nVision.DataPort.Service_1_0_0_0\Devart.Data.MySql.dll'.,InnerException-'.How can i solve it?Is there any solution without installing the same version in server & locally?Please let me know

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Mutiple version of Devert

Post by Pinturiccio » Wed 03 Dec 2014 16:43

Different provider versions on deployment and development computers can cause errors and incompatibilities. You can deploy your application without installing dotConnect for MySQL 7.2.77 on the deployment web server by performing the following actions:
1. Deploy Devart assemblies from the 7.2.77 provider with your application to the same folder;
2. Add all the necessary records with the 7.2.77 version to the config file of your application. For more information, please refer to http://www.devart.com/dotconnect/mysql/ ... yment.html

The reason is that dotConnect for MySQL adds records with its version to the machine.config file when the provider is installed. Your application reads the corresponding records from machine.config. In the development environment, the records with the version 7.2.77 are read, and everything works correctly. In the development environment, the records in the machine.config contain the version 6.60.258, and this probably causes the exception.

Post Reply