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,)
- Optionally Visual Studio Service Pak 1 (
- Visual Studio 2010 SDK ( if you didn’t got VS2010 SP1 or if you got it)
- NUnit, get a latest stable version (, have tested with 2.5.x, but latest versions will do too.
- TestDriven, friendly testing integrated to VS,, (personal edition will do)
- ADO.NET Entity Framework 4.1 (
- ANTLR Integration for Visual Studio (the parser for mysql grammar is written in ANTLR).
Get “ANTLR Language Support“ for Visual Studio from, 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, for example 6.5.4, choose to download the src package instead of the msi ((
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

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

Written By
Re: EntityFramework(Code First) and MySql
May 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.