指定的架构无效。错误。 [英] Schema specified is not valid. error.

查看:132
本文介绍了指定的架构无效。错误。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查看Erros的链接



As每张图片在数据源中访问Entity Framework表时提到错误。我从nuget控制台构建了Microsoft.AspNet.Providers -version 1.2(在EntityFramework 5.0下构建)并尝试插入表Application,Role,User,Profile,Memebership以及它们在密钥中的关系链接。我已经完成了重建但仍然出现了同样的错误。



其他人已经知道如何解决问题并指导我尽快修复。



我尝试了什么:



插入后我试图重新编译应用程序,角色,用户,配置文件,Memebership表格进入edmx(删除并构建新表格后)。

link to view Erros

As per picture mentioned error during access Entity Framework tables in data source. I've built the Microsoft.AspNet.Providers -version 1.2 (build under EntityFramework 5.0) from nuget console and try insert tables "Application,Role,User,Profile,Memebership" along with their inter relationship linking in keys. I've done with rebuild but still same error.

Could someone else who already know how to fix the problem and guide me to fixit in ASAP.

What I have tried:

I've tried to recompile after insert those "Application,Role,User,Profile,Memebership" tables into edmx (after delete and build a new one).

推荐答案

查看此SO答案。实体框架 - EF正在抛出错误。指定的架构无效 [ ^ ]
See this SO answer.Entity framework - EF is throwing an error. Schema specified is not valid [^]


嗯......很难猜到数据库模型的定义未知。



一般来说,这个错误可能至少有几个可能的原因:

Well... hard to guess till the definition of database model is unknown.

In general, there can be - at least - few possible reasons of this error:


  1. Enum不是在EF 5.0 for .NET 4.0中受支持。此功能适用于.NET 4.5中的EF 5
  2. 模型检查器无法使用我的EF模型检查当前数据库状态
  3. A [Key] 属性未定义
  4. 等。





我建议阅读实体框架(EF)文档 [ ^ ]解决此错误,尤其是部分:



  • EDMX文件 [ ^ ]
  • 关系和导航属性 [ ^ ]
  • 配置与Entity Framework Designer的关系:

  • 实体框架关系 - EF Designer [ ^ ]
  • 在Code First中配置关系:

  • 实体框架代码首次数据注释 [ ^ ]
  • 实体框架流畅的API - 关系 [ ^ ]


  • I'd suggest to read the Entity Framework (EF) Documentation[^] to resolve this error, especially the parts:


    • EDMX files[^]
    • Relationships and Navigation Properties[^]
    • To configure relationships with Entity Framework Designer:
    • Entity Framework Relationships - EF Designer[^]
    • To configure relationships in Code First:
    • Entity Framework Code First Data Annotations[^]
    • Entity Framework Fluent API - Relationships[^]

    • 这篇关于指定的架构无效。错误。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆