Nikola
Nikola

Reputation: 29

Could not load file or assembly 'MySql.Data, Version=8.0.29.0.. The located assembly's manifest definition does not match the assembly reference

I can't launch my C# project.

Unhandled exception. System.IO.FileLoadException: Could not load file or assembly 'MySql.Data, Version=8.0.29.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d'. The located assembly's manifest definition does not match the assembly reference. (0x80131040) File name: 'MySql.Data, Version=8.0.29.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' at MySQL_namespace.SQLWork.Initialize(String server_name, String _port, String database_name, String user, String pass) ...

It used to work before long time ago. Now, after I had issues with MySQL connection I have updated MySQL connector nuget. After that I also rebuilt it using .Net 5.0. Can't launch it now as it returns above error.

Upvotes: 0

Views: 928

Answers (2)

Housheng-MSFT
Housheng-MSFT

Reputation: 772

You can try as follows:

  1. After deleting the original nuget.
  2. Clean the project.
  3. Reinstall the new nuget.
  4. Rebuild the project.

Upvotes: 1

NicoF.
NicoF.

Reputation: 26

Did you make sure to copy it to the output directory?

Upvotes: 0

Related Questions