1
votes

Ok, I've googled and I know there are many questions on this topic but I think I am doing something wrong because I still get this error. Here is the situation, I just setup MySQL with ASP .NET MVC 4. It all worked fine and I wanted to setup EF 5 for it as well. The instructions said to add the following in to the config:

<configSections>
  <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<entityFramework>
  <contexts>
    <context type="Namespace.YourContextName, AssemblyName"><databaseInitializer type="Habanero.EntityFramework.MySql.DropCreateMySqlDatabaseIfModelChanges, AssemblyName"></databaseInitializer>
    </context>
  </contexts>
  <defaultConnectionFactory type="MySql.Data.MySqlClient.MySqlClientFactory,MySql.Data" />
</entityFramework>

The part that I can't figure out is Namespace.YourContextName, AssemblyName

The name space is in my own project and assembly so I tried: MyAssemblyNameSpace.DatabaseContext, MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken= null

I still get the above error. Let me make this clear, the namespace and the databasecontext are both in the assembly that the config is.

If I don't specify an assembly, it gives me the following error:

Could not load type 'MyAssemblyNameSpace.DatabaseContext' from assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

Here is the link to the instructions: http://www.nsilverbullet.net/2012/11/07/6-steps-to-get-entity-framework-5-working-with-mysql-5-5/

Thanks in advance

1

1 Answers

0
votes

The Namespace.YourContextName, AssemblyName will be the namespace along with the class name of your Context that you derived from ObjectContext or DbContext.

Example: CRMApplication.CRMContext,CRMApplication

Please update the config file and post the status here.