我有一个在.net v4下运行的asp.net网站.我已经从Entity Framework v5升级到v6.02,并且使用nuget提供的EntityFramework v4 dll在IIS express和.net4上本地运行良好.
我发布到我的托管公司并得到以下错误.升级到.net4.5可能会有所帮助,但目前我的提供商不支持此选项.
有什么建议?
System.Data.MetadataException: Schema specified is not valid. Errors: BkkpsModel.csdl(2,9) : warning 0005: Could not find schema information for the attribute 'Namespace'. BkkpsModel.csdl(2,32) : warning 0005: Could not find schema information for the attribute 'Alias'. BkkpsModel.csdl(2,98) : error 0005: The 'http://schemas.microsoft.com/ado/2009/02/edm/annotation:UseStrongSpatialTypes' attribute is not declared. BkkpsModel.csdl(2,2) : error 0010: The element Schema in namespace http://schemas.microsoft.com/ado/2009/11/edm was unexpected for the root element. The expected Schema in one of the following namespaces: http://schemas.microsoft.com/ado/2006/04/edm, http://schemas.microsoft.com/ado/2007/05/edm, http://schemas.microsoft.com/ado/2008/09/edm.
Run Code Online (Sandbox Code Playgroud)
Cyr*_*rus 13
您使用Entity Framework 6创建了EDMX文件,但是您将其与Entity Framework 5一起使用.Entity Framework 6使用版本3.0的EDMX文件,但实体框架5不支持它.
您必须将EDMX文件从3.0版修复到2.0版
最简单的方法是使用Entity Framework 5或更早版本在Visual Studio 2012项目中打开EDMX.实体数据模型设计器显示错误:无法显示文件.该文件引用与项目的目标框架不一致的XML命名空间.然后单击修改链接,设计人员自动修复您的EDMX文件.
或者:
1.以XML编辑器打开您的EDMX文件
2.更改以下元素:
from:
<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
to:
<edmx:Edmx Version="2.0" xmlns:edmx="http://schemas.microsoft.com/ado/2008/10/edmx">
from:
xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl"
to:
xmlns="http://schemas.microsoft.com/ado/2009/02/edm/ssdl"
from:
xmlns="http://schemas.microsoft.com/ado/2009/11/edm"
to:
xmlns="http://schemas.microsoft.com/ado/2008/09/edm"
from:
<Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs">
to:
<Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2008/09/mapping/cs">
... for all inconsistent xmlns
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
15073 次 |
| 最近记录: |