posts - 22 , comments - 13 , trackbacks - 0

My Links

News


My portfolio
MaansiTech

JavaScript Function .prototype

Download: Fast, Fun, Awesome


Archives

Post Categories

MySql.Data.MySqlClient version mismatched

Sometime we found that Server have MySQL .net connector pre-installed but matter is that they used old version or another version who not matched with our MySQL .connector version. so in this condition you have unable to make them work on Server. here is a solution how to deploy them with no problem like that.

in development system mainly we use .net connector so we need the same version on server to deploy our application. the problem is created because the component on development machine called installed library. if you add them in your project does not means that your project have the library. you code actually code the system library. so when you deploy the project they trying to called the server’system own library that are never matched if version mismatched.

How to solve this issue ?

if your server have less configuration that .net framework 4 then you can used .net 2 framework library from the folder

C:\Program Files (x86)\MySQL\MySQL Connector Net 6.3.6\Assemblies

this directory based upon X64 based system with version 6.3.6 of MySQL .net Connector.

here you can find out 2 directories

  • v2.0
  • v4.0

v2.0 for less configuration then .net 4 framework and v4.0 is equal or greater then .net configuration

[no matter if server have .net framework client profile]

when you open the directories you can find out the library MySql.Data.dll so you need to copy them [not cut paste it’s maybe trouble for future because the system have reference of Mysql library from here so i am not sure that it’s worked if somewhere code trying to call this library and the directories not have them so Exception maybe happened ]

so copy them in your project > bin folder you thing why i write this big matter when Visual studio add reference do that in a few seconds. well when you do this your project not have reference from system library because they have own so that they called dll from  the bin directory of project where code are live. if you add them using Add reference from Visual studio that they have reference and called the system library not have in project  > bin folder you can find them by going their bin folder after adding reference.

so when your project have their own dll in bin folder then they never trying to called the library from system. if you deploy this you find that they work even Server have Mysql connector installed or version of connector not matched with connector version of your project.

so when you do this your project never trying to find the library system have so they work with no exception. well if you have any trouble with this issue tell us by comment.

Print | posted on Wednesday, April 20, 2011 1:43 PM | Filed Under [ Visual studio browser .NET asp.net MVC Database MySQL Web ]

Feedback

No comments posted yet.
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: