1

I have one winforms application which uses MySQL as database. I was using the package MySqlBackup.NET to perform backup tasks in the application.

Now I updated the MySQL connector to version 8.0.17 and the MySqlBackup.NET to version 2.3.0, which are the most recent stable versions.

The issue is that when I try to use MySqlBackup.NET to perform the backup, I get one error saying that: "It was not possible to load file or assembly MySql.Data, Version=8.0.16.0".

In other words: MySqlBackup.NET is trying to locate MySql.Data version 8.0.16.0 and failing because the one I have is 8.0.17.

This makes little sense to me. After all, the dependencies of MySqlBackup.NET version 2.3.0 states that it requires MySql.Data version greater or equal to 8.0.16.0 which the one I have clearly satisifies.

What can I do to solve this issue? My initial idea was to clone the repository of MySqlBackup.NET on GitHub, update the reference to 8.0.17 and build it myself, but I think this is probably the last option.

user1620696
  • 10,825
  • 13
  • 60
  • 81
  • Have you tried a binding redirect? – mjwills Jul 23 '19 at 13:36
  • In fact I wasn't aware of this functionality, thanks for pointing it out @mjwills. I have googled about it, and if I understood I would need to add to the App.config a `dependentAssembly` with `assemblyIdentity` for `MySql.Data` and within it a `bindingRedirect` from old version 8.0.16.0 to 8.0.17.0. Is that it? If it is, I have tried and unfortunatelly it didn't work - same error. Up to this point the only thing that worked was cloning the GitHub repo and updating the MySql.Data reference there. – user1620696 Jul 23 '19 at 13:45
  • Cool - thanks for checking @user1620696. – mjwills Jul 23 '19 at 20:55

1 Answers1

0

The source code of MySqlBackup.NET is only a few files and folders.

You can simply add the source code directly into your project. Then, you can use any version of MySql.Data as you like.

mjb
  • 7,649
  • 8
  • 44
  • 60