问题原因,EF当前版本没有该方法,将EF版本升级即可. 1.packages.config <package id="EntityFramework" version="6.1.3" targetFramework="net40" /> 2.app.config <configSections> <!-- For more information on Entity Framework configuration,…
找不到方法:"Void System.Data.Objects.ObjectContextOptions.set_UseConsistentNullReferenceBehavior(Boolean)". 说明: 执行当前 Web 请求期间,出现未经处理的异常.请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息. 异常详细信息: System.MissingMethodException: 找不到方法:"Void System.Data.Objects.O…
找不到方法:“Void System.Data.Objects.ObjectContextOptions.set_UseConsistentNullReferenceBehavior(Boolean)”. 说明: 执行当前 Web 请求期间,出现未经处理的异常.请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息. 异常详细信息: System.MissingMethodException: 找不到方法:“Void System.Data.Objects.ObjectConte…
最近调试EF的时候遇到下面这个问题 System.MissingMethodException:“找不到方法:“System.Data.Entity.ModelConfiguration.Configuration.PrimitivePropertyConfiguration System.Data.Entity.ModelConfiguration.Configuration.PrimitivePropertyConfiguration.HasDatabaseGeneratedOption(S…
可以强迫部署EntityFramework.SqlServer.dll这个文件到输出目录 找到1个老外的帖子,戳这里(本人测试无效,大家有可能试一下..) 解决方案以下: 在EF的上下文代码CS文件(Model1.Context.cs)中添加这个方法 public void FixEfProviderServicesProblem() { //The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderS…
note:you can delete reference of entityframework when using this classes.it`s just a simple repohelper.the code below can also include a getpagedlist method when paging. have fun,it`s simple,just create edmx file from database.all one sentence.but wh…
找不到方法:"!!0[] System.Array.Empty()". 这个原因是没装.net framework 4.6…
找不到方法:“Boolean System.Runtime.Serialization.DataContractAttribute.get_IsReference()”.的解决办法站点发布后部署到了两台服务器,发现一天运行没问题,另一台执行页面的时候报下面的错误.找不到方法:“Boolean System.Runtime.Serialization.DataContractAttribute.get_IsReference()”,网上查了一下,说是.netFramework3.5要打sp1补丁.…
找不到方法"Boolean System.Threading.WaitHandle.WaitOne(TimeSpan)" http://www.microsoft.com/downloads/details.aspx?displaylang=zh-cn&FamilyID=5b2c0358-915b-4eb5-9b1d-10e506da9d0f从微软官方下载最新的 Microsoft .NET Framework 2.0 Service Pack 2 安装,然后重新启动 Flas…
Windows服务中程序发布之后会如下错误: 无法为具有固定名称“System.Data.SqlClient”的 ADO.NET 提供程序加载在应用程序配置文件中注册的实体框架提供程序类型“System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer”.请确保使用限定程序集的名称且该程序集对运行的应用程序可用.有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkId…
<configSections> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFramewor…
找不到方法 Void Newtonsoft.Json.JsonConvert.set_DefaultSettings 因为 Newtonsoft.Json.dll 的版本号问题: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Blend 下的版本号为 4.5.11 最新版本号为 6.0.4 下载.复制,替换.攻克了. 版本号啦,版本号. •New feature - Added Merge to LINQ to JSON •New fea…
发生System.Data.Entity.Validation.DbEntityValidationException这个异常的时候,如果没有用特定的异常类去捕捉,是看不到具体信息的. 通常都是用System.Data.Entity.Validation.DbEntityValidationException去捕捉: try { // 写数据库 } catch (DbEntityValidationException dbEx ) { } 这个时候再去看就可以看到了. string result…
EF6更新 数据出现 System.Data.Entity.Infrastructure.DbUpdateConcurrencyException: Store update, insert, or delete statement affected an unexpected number of rows (0)....异常 先还原一下问题出现的场景: 首先,获取 数据倒view显示,并绑定到文本框显示,点击提交时候,出现上面异常信息: 数据更新错误,通常包含以下几种: 1,DbEntityV…
1.EF 5.0解决方法 先卸载EF:Uninstall-Package EntityFramework -Force 在安装EF5.0:Install-Package EntityFramework –Version 5.0.0 2.EF 6.0 解决方法 DbEntityEntry entry = nc.Entry<Sys_Log>(p); entry.State = System.Data.Entity.EntityState.Unchanged; 要多一个Entity. 我用的是6.0…
报错:无法将类型"System.Data.EntityState"隐式转换为"System.Data.Entity.EntityState".   出错语句停留在:DataContext.Entry(entity).State = EntityState.Modified; 从语法上看没有什么错误.DataContext是在Model层通过添加edmx自动生成的,而出错语句所在的数据层安装了最新版的Entity Framework,我们知道:在edmx中创建实体导入…
一.错误信息 Entity Framework 6.0数据迁移:Add-Migration XXXX 命令发生错误 System.Reflection.TargetInvocationException: 调用的目标发生了异常. ---> System.TypeInitializationException: “System.Data.Entity.SqlServer.SqlProviderServices”的类型初始值设定项引发异常. ---> System.TypeLoadExceptio…
找半天才找到 ef添加数据时出错原因:数据库表中没有主键 ,就算表中有自增列 Added方法也会报错: -        this._db.SaveChanges() “this._db.SaveChanges()”引发了“System.Data.Entity.Infrastructure.DbUpdateConcurrencyException”类型的异常    int {System.Data.Entity.Infrastructure.DbUpdateConcurrencyExceptio…
[15/08/19 00:03:10] [DataManager-7292-ERROR] System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'System.Data.Entity.Internal.AppConf…
错误描述: 1 类型“System.Data.Entity.DbContext”在未被引用的程序集中定义.必须添加对程序集“EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”的引用. D:\HF_Source\webapitest\test2\DFSoft.Plat.SQLServerDAL\BaseService\B_AgreementTypeDAL.cs 30 13 DFSof…
最近刚学MVC,跟着网上的博客学习,发现代码中有这样一句: using System.Data; using System.Data.Entity; 我项目引用的时候,也引用了System.Data.Entity,但我VS的智能感知只有如下代码. using System.Data.EntityClient; 后经百度查询结果,最终发现,System.Data.Entity 这个是引用的EntityFramework,于是在项目中引用了下EntityFramework就好了. [caption…
Memcache实例的Get方法时抛出了异常“Unable to load type System.Data.Entity.DynamicProxies.AdInfoItems_19CD09C8E46569CE66DA116258344075907E70CA60DDAA48F3D8B1AC0085248D required for deserialization.”,字面上的意思是没有反序列化.仔细检查了相关类,发现都有加“[Serializable]”. 项目是用EF做的,memcache里存…
<connectionStrings> <add name="ConnectionStringName" providerName="System.Data.SqlClient" connectionString="Data Source=.;Initial Catalog=DataBaseName;Integrated Security=True;Pooling=False" /> </connectionStri…
在一开始时将connectionStrings 写在了configSections之上如下图一示,结果抛出:“System.Data.Entity.Internal.AppConfig”的类型初始值设定项引发异常. 图一:最初配置 图二:抛出异常 解决方法,是将connectionStrings 写在了configSections之下,如图三 图三:调整后的配置…
今天做东西遇到了,这样的一个问题,最后了半天才找到问题所在,现在给大家分享一下问题所在: 传入字典的模型项的类型为“System.Data.Entity.DynamicProxies.doctorUserRelation_03D17F5AB0B5FFF501592690CCC9482D18F6A762589D7C84F48D8C57891D2513”,但此字典需要类型“System.Collections.Generic.IEnumerable`1[WeixinDocter.Models.doc…
错误截图: Configuration Error :<add extension=".edmx" type="System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider" /> 解决方法1: .demx文件默认要并行放在项目的根目录下即可 有其他解决方法以后再补上.......…
异常描述:   捕捉到 System.Data.Entity.Infrastructure.DbUpdateException  HResult=-2146233087  Message=无法更新 EntitySet“CashRequest”,因为它有一个 DefiningQuery,而 <ModificationFunctionMapping> 元素中没有支持当前操作的 <InsertFunction> 元素.  Source=EntityFramework  StackTrac…
在学习EF code First的小案例的时候,遇见了这个异常 <configSections> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <section name="entityFramework" type="System.Data.Entity.In…
使用EF flument API  修改映射数据库字段的自增长 modelBuilder.Entity<Invoice>().Property(p => p.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.None); 报错Method not found: 'System.Data.Entity.ModelConfiguration.Configuration.XXX 卸载所有项目中引用的EntityFramework 重新…
错误信息: “System.Data.Entity.Core.EntityCommandExecutionException”类型的异常在 EntityFramework.SqlServer.dll 中发生,但未在用户代码中进行处理. 其他信息:执行命令定义时出错.有关详细信息,请参阅内部异常. 跟踪代码找到详细信息: Entity Framework已有打开的与此Command相关联的DataReader,必须首先将它关闭. EF内部是使用DataReader作为资料存取,所以如果没关闭连接就…