简体   繁体   中英

Use a version of MySql.Data different than installed connector

I'm looking for a solution (if possible at all) to use a version of MySql.Data that is more recent than the installed connector on the dev machine.

For example, we had the problem of some Mysql bug showing up in our debug (EF6 was transforming a StartsWith() in an SQL Locate() ) even though it was said to be fixed in the DLL present in the project (6.9.5).

When we tested it with a machine that had the 6.9.5 connector installed (in Program Files) it worked.

Now, I realize we should have the most up-to-date connector installed, but we also sometimes (even if rarely) have to use some older version. Or we have to fix something without having the time to wait for an admin to grant us the install of a new connector.

So the question is, is there any way to force the use of the DLL that is actually in the project references, no matter which one is installed on the machine ?

And the bonus question, what happens if we have the most recent connector installed and open a project with an older DLL ? will it use the one installed or is it only when the DLL inside the project is more recent ?

EDIT:

As pointed by a now deleted comment, shouldn't the project use the DLL referenced in the properties anyway ? This one was installed through NuGet and pointing to the Packages folder.

I have a project (vs 2013) using v6.5.5.0 (because of the server where it gets deployed) while I update to the newest version on my machine. This is what I did: Copied the dll from the server to my machine, added the reference to the project, set in properties "Copy Local = true" and everything works fine. Never had a issue.

I think the way to force it is to set "Copy Local=true", it should use the referenced dll every time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM