Skip navigation links

MySQL Forums :: Connector/NET and C#, Mono, .Net :: EntityFramework(Code First) and MySql


Advanced Search

Re: EntityFramework(Code First) and MySql
Posted by: Fernando Gonzalez ()
Date: May 15, 2012 09:26PM

Hi Guys,

Sorry for the delay on response, two things
- Connector/NET doesn't support yet Code First 4.3, just 4.1 (we are working on that).
The fix will work for 4.1.
- We are still a few weeks away from a new maintenance release, please follow these steps to build Connector/NET from source:

1. First you need the following software:
- Visual Studio 2010 Professional Edition or better (you can use a trial http://www.microsoft.com/visualstudio/en-us/try,)
- Optionally Visual Studio Service Pak 1 (http://www.microsoft.com/en-us/download/details.aspx?id=23691).
- Visual Studio 2010 SDK (http://www.microsoft.com/en-us/download/details.aspx?id=2680 if you didn’t got VS2010 SP1 or http://www.microsoft.com/en-us/download/details.aspx?id=21835 if you got it)
- NUnit, get a latest stable version (http://nunit.org/?p=download), have tested with 2.5.x, but latest versions will do too.
- TestDriven, friendly testing integrated to VS, http://www.testdriven.net/download.aspx, (personal edition will do)
- ADO.NET Entity Framework 4.1 (http://www.microsoft.com/en-us/download/details.aspx?id=8363).
- ANTLR Integration for Visual Studio (the parser for mysql grammar is written in ANTLR).
Get “ANTLR Language Support“ for Visual Studio from http://visualstudiogallery.msdn.microsoft.com/25b991db-befd-441b-b23b-bb5f8d07ee9f, latest version.
No need to download the runtime for ANTLR, it is already included in Connector/NET source distribution.
2. Install everything
3. Pick the last release from Connector/NET from http://dev.mysql.com/downloads/connector/net/, for example 6.5.4, choose to download the src package instead of the msi ((mysql-connector-net-6.5.4-src.zip).
4. Create a key for sign assemblies (if you want to install on the GAC) by openning a Visual Studio prompt and running this commands
sn -k cnet.snk
sn -i cnet.snk ConnectorNet
sn -p cnet.snk pubkeybinary
sn -tp pubkeybinary > pubkey.txt
5. From the place where you have unzipped Connector/NET source, open the solution MySqlClient.sln
6. You need to reedit the public key used for all InternalsToVisble attributes, they are in the AssemblyInfo.cs file for the following projects
MySql.Data
MySql.Data.Entity

The public key is the one from pubkey.txt from step 4., change it like shown below
[assembly: InternalsVisibleTo("MySql.Data.Entity, PublicKey =<your new public key here> )]
(Ensure that the 320 chars public key is in a single line, without carriage return, spaces, etc.)
7. Now you should be able to build everything
(You can ignore the errors in the EDMX files: Error 175: the specified store provider cannot be found in the configuration, or is not valid.)
8. At this point you have the following assemblies built.
MySql.Data.dll (core ADO.NET provider)
MySql.Data.Entity.dll (entity framework support)
MySql.Web.dll (ASP.NET providers)
Mysql.VisualStudio.dll (VS Integration)

8. At this point you can apply the fix, and rebuild.

Options: ReplyQuote


Subject Written By Posted
EntityFramework(Code First) and MySql Bin Xiang 03/07/2012 08:19PM
Re: EntityFramework(Code First) and MySql Fernando Gonzalez 04/16/2012 12:06PM
Re: EntityFramework(Code First) and MySql Dawid Cieszyński 05/08/2012 06:53AM
Re: EntityFramework(Code First) and MySql Delush Fernando 05/14/2012 03:18PM
Re: EntityFramework(Code First) and MySql Delush Fernando 05/13/2012 06:54PM
Re: EntityFramework(Code First) and MySql Dawid Cieszyński 05/14/2012 02:50AM
Re: EntityFramework(Code First) and MySql Fernando Gonzalez 05/15/2012 09:26PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.