Home > Uncategorized > How to make your .NET application work with any version of MySQL driver for .NET

How to make your .NET application work with any version of MySQL driver for .NET

After updating the MySQL Connector for .NET at your system you may find that your .NET applications or libraries (aka assemblies) that use it (including the data designers at your Visual Studio projects that use the MySQL Connector for .NET) no longer work cause they keep looking for a previous version of the driver.

To fix this you should open project settings (e.g. from Solution Explorer pane) and go to "References" tab, then select the "MySQL.Data" reference (that you had added to your project explicitly or implicitly by using that connector in a data-aware control property editor) and at the Properties pane (show it from the View menu, unfortunately there’s no context sensitive menu to show Properties for a reference), change the "Specific Version" to false. Then close project settings, save and recompile your project to produce an executable assembly that works (or at least tries to) with any version of the MySQL Connector for .NET.

Note that this makes your compiled application work with newer versions of the MySQL Connector for .NET, not your project locate automatically the new MySql.Data.dll automatically if you install to a different folder at every new version (as is the default). Thus, if you don’t install the connector every time to the same folder you’ll have to remove the MySql.Data reference and add it again (alas, the "Path" property is read-only for references). Do remember to set "Specific Version" property again to false though.

image

Advertisements
Categories: Uncategorized Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: