Guilherme Oderdenge
Guilherme Oderdenge

Reputation: 5001

Keyword not supported: 'metadata' + MySQL

The error

The error

When it happens

I'm attempting to create a simple controller using a ViewModel as model.

Connection String

<connectionStrings>
   <add name="BoaPropostaEntities"
        connectionString="metadata=res://*/Models.MyApp.csdl|res://*/Models.MyApp.ssdl|res://*/Models.MyApp.msl;provider=MySql.Data.MySqlClient;provider connection string='server=localhost;user id=root;password=root;persistsecurityinfo=True;database=mydatabase'"
        providerName="MySql.Data.MySqlClient"/>

Web.Config spotlight

I also added to Web.Config some settings:

<system.data>
  <DbProviderFactories>
  <clear />
  <add name="MySQL Data Provider" 
       invariant="MySql.Data.MySqlClient" 
       description=".Net Framework Data Provider for MySQL"
       type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
</DbProviderFactories>

And:

<entityFramework>
  <defaultConnectionFactory type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data"/>
  <contexts>
    <context type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity"/>
  </contexts>
</entityFramework>

All references seems to be okay.

The question

Ideas to resolve my problem?

Environment

Windows 8.1 + Visual Studio 2013 + MVC 4 + MySQL 5.6 + Connector/Net 6.8.3 + MySQL for Visual Studio Plug-In 1.1.0 + Entity Framework 5

What I already tried

Duplicated?

I already searched in lots of topics about this subject. Unfortunatelly, until now, without success. I'm thinking that my problem is related specifically with my connectionString.

If you want, post the topics related — I can confirm that isn't my solution. Anyway, sorry about one more topic about this, but nothing else is helping me.

Upvotes: 0

Views: 3589

Answers (1)

SLaks
SLaks

Reputation: 887433

That's an EF connection string, not a MySQL connection string.

You need providerName="System.Data.EntityClient".

Upvotes: 3

Related Questions