MySQL com EntityFramework

Olá,

Ao tentar criar um item Data no meu projeto Asp.net MVC 5 recebi o seguinte erro:

Unable to generate the model because of the following exception: 'System.Data.StrongTypingException: The value for column 'IsPrimaryKey' in table 'TableDetails' is DBNull. ---> System.InvalidCastException: Specified cast is not valid.


E também

The value for column 'IsPrimaryKey' in table 'TableDetails' is DBNull. ---> System.InvalidCastException: Specified cast is not valid.
 
Depois de algumas tentativas e pesquisas descobri uma solução simples:

Abra o gerenciador de serviços (services.msc)

Reinicie o serviço MySQL57

Depois execute os seguintes comandos no MySQL:

use <seubancodedados>;
set global optimizer_switch='derived_merge=OFF';



Após isso tente novamente adicionar a base da dados que deve dar certo agora!

Boa sorte!


Comentários

Postar um comentário

Postagens mais visitadas deste blog

Como instalar o Corel X3 no Windows 10

Como resolver o erro "the data provider 'mysql.data.mysqlclient' could not be found in the system configuration. unable to find the requested .net framework data provider. it may not be instaled"

Vulcão no Brasil