asp.net – 使用EF5从4.5降级到4.0后无法加载文件或程序集“Enti
发布时间:2020-12-15 21:00:39 所属栏目:asp.Net 来源:网络整理
导读:我最近使用Entity Framework 5开发了一个.net 4.5库.一切正常,直到我被告知我必须降级到.net 4.0才能与 Windows 2003保持兼容. 我使用程序包管理器控制台卸载了EF 5并获得了成功的消息,然后这个消息: Failed to generate binding redirects for 'MyProjectN
我最近使用Entity Framework 5开发了一个.net 4.5库.一切正常,直到我被告知我必须降级到.net 4.0才能与
Windows 2003保持兼容.
我使用程序包管理器控制台卸载了EF 5并获得了成功的消息,然后这个消息: Failed to generate binding redirects for 'MyProjectName'. An item with the same key has already been added. 降级和安装Entity Framework后会出现相同的消息. 一切都在编译.但是在执行时我有这个例外: The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception. Could not load file or assembly 'EntityFramework,Version=5.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"EntityFramework,PublicKeyToken=b77a5c561934e089" 在Web.Config(以及库的App.Config)中,我有以下几行: <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection,EntityFramework,PublicKeyToken=b77a5c561934e089" requirePermission="false"/> ... <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> 任何帮助,将不胜感激. 解决方法
由于另一个话题,我终于解决了这个问题:
could-not-load-file-or-assembly-entityframework-after-downgrading-ef-5-0-0-0
尽管我使用Package Manager Console安装了EF 5软件包. .Net 4.0的实体框架的实际版本是4.4版.我已经改变了配置文件中的值,它确实有效! <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection,Version=4.4.0.0,PublicKeyToken=b77a5c561934e089" requirePermission="false"/> ... <dependentAssembly> <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral"/> <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0"/> </dependentAssembly> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net-mvc – 如何使用Data Annotations Extensions在属性
- 如何使用ASP.NET中的C#代码以PDF,HTML和DOC格式导出Crystal
- 登录到MVC 5 ASP.NET模板从根文件夹移动时Web应用程序失败
- .net – 解密字符串时偶尔出现错误数据错误:System.Securi
- asp.net-web-api – 使用OWIN SelfHost和Windows身份验证的
- asp.net-web-api – 基于参数类型重载Web api操作方法
- asp.net – HttpMessageHandler与DelegatingHandler
- asp.net-mvc – 使用Checkboxes绑定到具有强类型MVC视图的B
- asp.net-mvc – 加载程序集时会发生什么?
- 关于ADO.NET连接池
推荐文章
站长推荐
- asp.net实现access数据库分页的方法
- asp.net-mvc – SelectListItem中的Selected属性
- 在Mono上使用F#和ASP.NET Webforms
- asp.net-mvc – 在MVC3中使用Html.BeginForm是什
- asp.net-mvc-3 – 如何将HttpContext传递给MVC3应
- asp.net-mvc – Web Deploy/Publish正在添加一个
- asp.net-mvc – 多个模型和Breeze上下文的元数据
- .net – Umbraco vs DotNetNuke:无法决定哪一个
- asp.net-mvc – HiddenFor(x => x.Id)正在由UrlP
- 向asp.net添加样式表(使用Visual Studio 2010)
热点阅读