如何自定义的MySQL Connector / NET? [英] How to customize MySql Connector/net?

查看:309
本文介绍了如何自定义的MySQL Connector / NET?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的MySQL Connector / NET是不能正常工作。该小组的工作虫子只有3人,他们不解决复杂的问题。仍有较2009年我想定制自己的连接器,以便它适合我的复杂形势悬而未决的问题。我怎么能在我的项目,而不是他们使用一个定制版本?

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?

推荐答案

步骤1)下载

为了定制甲骨文的MySQL Connector / NET的版本,你将不得不在这里下载源$ C ​​$ C:的 http://dev.mysql.com/downloads/connector/net/

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/

步骤2)打开

接下来,你将不得不解压缩下载的源文件。连接器的肉将在两个项目中, MySql.Data MySql.Data.Entity (< A HREF =htt​​p://stackoverflow.com/q/12886068/1026459>什么是在MySQL供应商?)。

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? ).

第3步)编辑连接器,

请以解决您的复杂形势的任何编辑您想要的类。

Make any edits to the classes you wish in order to fix your complex situation.

第4步)拆下签名

这一步将使重新分配您的编辑不可取的,你可能会签署它,如果你想使的变化,但本地部署是不必要的。

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.

  • MySql.Data.Entity 中的的AssemblyInfo.cs 注释掉该行:

    //[assembly: AssemblyKeyName("ConnectorNet")]
    

  • MySql.Data 中的的AssemblyInfo.cs 进行这些更改:

    //[assembly: AssemblyKeyName("ConnectorNet")]
    [assembly: InternalsVisibleTo("MySql.Data.Entity")]
    

    第5步)编译和打造​​以

    建立 MySql.Data 第一个的。一旦建成,打开 MySql.Data.Entity 。将有一个有关无法找到 MySql.Data 警告。参考添加到新建成的 MySql.Data 斌/调试文件夹内。建立 MySql.Data.Entity 发布

    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.

    第六步)移动文件

    MySql.Data.Entity 斌/发布文件夹应该既是 MySql.Data MySql.Data.Entity 。每次取一个,覆盖对口项目的文件夹中。

    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.

    在项目中的第7步)更新引用

    在你的项目中,转到参考区域。删除这两个 MySql.Data MySql.Data.Entity 。在引用右键单击,点击添加引用,选择浏览选项卡,导航到包文件夹,​​然后添加两个 MySql.Data MySql.Data.Entity 你在第6步摆在那里。

    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.

    第8步)修改的web.config

    Step 8) Modify web.config

    将有几个的web.config 里面提到 MySql.Data 的。他们每个人都会有公钥= c5687fc88969c44d 必须删除(从全部)。

    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).

    第9步),做起来很

    享受您的自定义连接器!

    Enjoy your customized connector!

    这篇关于如何自定义的MySQL Connector / NET?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆