MySql Connector/Net is not working properly. The team working on bugs is only 3 people and they do not resolve complex issues. There are still unresolved issues from 2009. I want to customize their connector so that it works for my complex situation. How can I use a customized version in my project instead of theirs?
解决方案
Step 1) Download
In order to customize a version of oracle's mysql connector / net you are going to have to download the source code here: http://dev.mysql.com/downloads/connector/net/
Step 2) Open
Next, you are going to have to unzip the downloaded source files. The meat of the connector will be in two of the projects, MySql.Data and MySql.Data.Entity ( What is in a mysql provider? ).
Step 3) Edit The Connector
Make any edits to the classes you wish in order to fix your complex situation.
Step 4) Remove the signature
This step will make redistributing your edits undesirable, you may sign it and make the changes if you wish but for a local deployment it is unnecessary.
Inside of MySql.Data.Entity's AssemblyInfo.cs comment out this line:
//[assembly: AssemblyKeyName("ConnectorNet")]
Inside of MySql.Data's AssemblyInfo.cs make these changes:
//[assembly: AssemblyKeyName("ConnectorNet")]
[assembly: InternalsVisibleTo("MySql.Data.Entity")]
Step 5) Compile and Build In Order
Build MySql.Data first. Once built, open MySql.Data.Entity. There will be a warning about not being able to find MySql.Data. Add the reference to the newly built MySql.Data inside of the bin/Debug folder. Build MySql.Data.Entity as Release.
Step 6) Move the files
Inside of the bin/Release folder of MySql.Data.Entity should be both MySql.Data and MySql.Data.Entity. Take each one and overwrite their counterparts in your project's package folder.
Step 7) Update References in your project
Inside of your project, go to the references area. Remove both MySql.Data and MySql.Data.Entity. Right click on References, click Add Reference, select the Browse tab, navigate to the package folder, and then add both MySql.Data and MySql.Data.Entity that you placed there in Step 6.
Step 8) Modify web.config
There will be several mentions of MySql.Data inside of web.config. Each one of them will have PublicKeyToken=c5687fc88969c44d which must be removed (from all of them).
Step 9) Make it so
Enjoy your customized connector!