Microsoft.Data.OData Breeze Server的版本不匹配 – 适用于Web
发布时间:2020-12-14 01:59:28 所属栏目:Windows 来源:网络整理
导读:Breeze Server – 适用于Nuget中的Web API 2版本1.4.8,安装Microsoft.Data.OData版本= 5.6.1,但引用版本5.6.0. 见下面的错误: 元数据查询失败:*;无法加载文件或程序集“Microsoft.Data.OData,Version = 5.6.0.0,Culture = neutral,PublicKeyToken = 31bf38
Breeze Server – 适用于Nuget中的Web API 2版本1.4.8,安装Microsoft.Data.OData版本= 5.6.1,但引用版本5.6.0.
见下面的错误: 元数据查询失败:*;无法加载文件或程序集“Microsoft.Data.OData,Version = 5.6.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35”或其依赖项之一.定位的程序集的清单定义与程序集引用不匹配. (HRESULT异常:0x80131040) 解决方法
确保更正正确的程序集版本控制(如果是Web项目,则为web.config):
<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="0.0.0.0-5.6.0.0" newVersion="5.6.1.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="0.0.0.0-5.6.0.0" newVersion="5.6.1.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Spatial" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="0.0.0.0-5.6.0.0" newVersion="5.6.1.0" /> </dependentAssembly> </assemblyBinding> 然后在Data项目的app.config文件中,注释掉< entityFramework>部分: <entityFramework> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory,EntityFramework" /> <providers> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices,EntityFramework.SqlServer" /> </providers> </entityFramework> 然后,如果您还没有,请添加以下配置部分: <configSections> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection,EntityFramework,Version=6.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089" requirePermission="false" /> </configSections> 最后,在您的XxDbContext类中,添加/修改您的静态构造函数: static XxDbContext() { var type1 = typeof(System.Data.Entity.SqlServer.SqlProviderServices); } 这些步骤解决了我的问题.祝好运. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- windows – 如何使用cmake生成.msi安装程序?
- 在Windows上使用Ubuntu上的Bash AppEngine SDK for Go
- OpenCascade极简环境搭建(QT环境)
- Windows-8 – HttpClient的自定义用户代理?
- windows-phone-7 – WP7如何使用工具包TransitionFrame?
- windows-phone-8 – Windows Embedded 8掌上电脑(WE8H)支持
- 在Windows和活动目录上使用什么git服务器解决方案?
- 任何人都有删除特定本地Windows配置文件的脚本?
- 黑-客***用的最短代码大揭秘,颠覆你的世界观!
- win10 jdk的安装和环境变量的配置