none
Problema ao criar Data Model RRS feed

  • Pergunta

  • Unable to generate the model because of the following exception: 'System.Data.Entity.Core.EntityCommandCompilationException: An error occurred while preparing the command definition. See the inner exception for details. ---> System.Data.Entity.Core.ProviderIncompatibleException: The provider did not create a CommandDefinition. ---> System.NotImplementedException: The method or operation is not implemented.
       at MySql.Data.Entity.SelectStatement.AddDefaultColumnsForFragment(InputFragment input)
       at MySql.Data.Entity.SelectStatement.AddDefaultColumnsForFragment(InputFragment input)
       at MySql.Data.Entity.SelectStatement.AddDefaultColumnsForFragment(InputFragment input)
       at MySql.Data.Entity.SelectStatement.AddDefaultColumnsForFragment(InputFragment input)
       at MySql.Data.Entity.SelectStatement.AddDefaultColumnsForFragment(InputFragment input)
       at MySql.Data.Entity.SelectStatement.AddDefaultColumnsForFragment(InputFragment input)
       at MySql.Data.Entity.SelectStatement.AddDefaultColumnsForFragment(InputFragment input)
       at MySql.Data.Entity.SelectStatement.Wrap(Scope scope)
       at MySql.Data.Entity.SelectGenerator.WrapIfNotCompatible(SelectStatement select, DbExpressionKind expressionKind)
       at MySql.Data.Entity.SelectGenerator.Visit(DbFilterExpression expression)
       at System.Data.Common.CommandTrees.DbFilterExpression.Accept[TResultType](DbExpressionVisitor`1 visitor)
       at MySql.Data.Entity.SqlGenerator.VisitInputExpression(DbExpression e, String name, TypeUsage type)
       at MySql.Data.Entity.SelectGenerator.VisitInputExpressionEnsureSelect(DbExpression e, String name, TypeUsage type)
       at MySql.Data.Entity.SelectGenerator.Visit(DbProjectExpression expression)
       at System.Data.Common.CommandTrees.DbProjectExpression.Accept[TResultType](DbExpressionVisitor`1 visitor)
       at MySql.Data.Entity.SelectGenerator.GenerateSQL(DbCommandTree tree)
       at MySql.Data.MySqlClient.MySqlProviderServices.CreateDbCommandDefinition(DbProviderManifest providerManifest, DbCommandTree commandTree)
       at System.Data.Common.DbProviderServices.CreateCommandDefinition(DbProviderManifest providerManifest, DbCommandTree commandTree)
       --- End of inner exception stack trace ---
       at Microsoft.Data.Entity.Design.VersioningFacade.LegacyProviderWrapper.LegacyDbProviderServicesWrapper.CreateDbCommandDefinition(DbProviderManifest providerManifest, DbCommandTree commandTree)
       at System.Data.Entity.Core.Common.DbProviderServices.CreateDbCommandDefinition(DbProviderManifest providerManifest, DbCommandTree commandTree, DbInterceptionContext interceptionContext)
       at System.Data.Entity.Core.Common.DbProviderServices.CreateCommandDefinition(DbCommandTree commandTree, DbInterceptionContext interceptionContext)
       at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition..ctor(DbProviderFactory storeProviderFactory, DbCommandTree commandTree, DbInterceptionContext interceptionContext, IDbDependencyResolver resolver, BridgeDataReaderFactory bridgeDataReaderFactory, ColumnMapFactory columnMapFactory)
       --- End of inner exception stack trace ---
       at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition..ctor(DbProviderFactory storeProviderFactory, DbCommandTree commandTree, DbInterceptionContext interceptionContext, IDbDependencyResolver resolver, BridgeDataReaderFactory bridgeDataReaderFactory, ColumnMapFactory columnMapFactory)
       at System.Data.Entity.Core.EntityClient.EntityCommand.CreateCommandDefinition()
       at System.Data.Entity.Core.EntityClient.EntityCommand.TryGetEntityCommandDefinitionFromQueryCache(EntityCommandDefinition& entityCommandDefinition)
       at System.Data.Entity.Core.EntityClient.EntityCommand.GetCommandDefinition()
       at System.Data.Entity.Core.EntityClient.EntityCommand.InnerPrepare()
       at System.Data.Entity.Core.EntityClient.EntityCommand.Prepare()
       at System.Data.Entity.Core.EntityClient.EntityCommand.ExecuteReader(CommandBehavior behavior)
       at Microsoft.Data.Entity.Design.VersioningFacade.ReverseEngineerDb.SchemaDiscovery.EntityStoreSchemaGeneratorDatabaseSchemaLoader.LoadDataTable[T](String sql, Func`2 orderByFunc, DataTable table, EntityStoreSchemaFilterObjectTypes queryTypes, IEnumerable`1 filters, String[] filterAliases)
       at Microsoft.Data.Entity.Design.VersioningFacade.ReverseEngineerDb.SchemaDiscovery.EntityStoreSchemaGeneratorDatabaseSchemaLoader.LoadRelationships(IEnumerable`1 filters)
       at Microsoft.Data.Entity.Design.VersioningFacade.ReverseEngineerDb.SchemaDiscovery.EntityStoreSchemaGeneratorDatabaseSchemaLoader.LoadStoreSchemaDetails(IList`1 filters)
       at Microsoft.Data.Entity.Design.VisualStudio.ModelWizard.Engine.ModelGenerator.GetStoreSchemaDetails(StoreSchemaConnectionFactory connectionFactory)
       at Microsoft.Data.Entity.Design.VisualStudio.ModelWizard.Engine.ModelGenerator.CreateStoreModel()
       at Microsoft.Data.Entity.Design.VisualStudio.ModelWizard.Engine.ModelGenerator.GenerateModel(List`1 errors)
       at Microsoft.Data.Entity.Design.VisualStudio.ModelWizard.Engine.ModelBuilderEngine.GenerateModels(String storeModelNamespace, ModelBuilderSettings settings, List`1 errors)
       at Microsoft.Data.Entity.Design.VisualStudio.ModelWizard.Engine.ModelBuilderEngine.GenerateModel(ModelBuilderSettings settings, IVsUtils vsUtils, ModelBuilderEngineHostContext hostContext)'.
    Loading metadata from the database took 00:00:00.5146089.
    Generating the model took 00:03:10.0974978.
    

    Recebo essa mensagem de erro sempre que tento gerar um novo Data Model de um banco de dados já existente. Estou utilizando Mysql Server e independente do banco que eu selecione tenho essa mensagem de retorno, o que pode estar acontecendo?


    Juan Nogueira
    Visite o meu site:
    www.juannogueira.com.br
    Se foi útil, marque como resposta e faça a alegria de um programador :)

    quarta-feira, 3 de junho de 2015 14:43

Todas as Respostas

  • Juan, geralmente isso acontece quando seu schema e seus mapping files não estão sincronizados por alguma coluna ter sido renomeada ou apagada, ou então, se você especificou nome diferente para o nome da tabela no repositório e na base de dados.




    Andrielle Azevedo de Paula

    MTAC | Analista Pleno I | IT Developer .NET | ALM Professional

    • Sugerido como Resposta Daniel Brito br quarta-feira, 17 de junho de 2015 10:29
    terça-feira, 16 de junho de 2015 18:07