04 2012 档案

摘要:错误Maximum number of items that can be serialized or deserialized in an object graph is '65536'. Change the object graph or increase the MaxItemsInObjectGraph quota.解决服务器端:ServiceHost host = new ServiceHost(serviceType, uri);foreach (IServiceBehavior behavior in host.Description.Behaviors){ i 阅读全文
posted @ 2012-04-26 13:07 深圳大漠 阅读(1612) 评论(0) 推荐(0) 编辑
摘要:EF在N-Tier架构下的保存注意事项 szjay前提一个实体对象必须先进入ObjectContext中才能进行增、删、改的操作。新增新增的过程很简单,调用AddObject方法即可。修改如果要修改的实体对象是Detached状态,那么必须先调用AttachTo方法。AttachTo方法告诉ObjectContext,虽然当前实体对象没有在ObjectContext中存在,但它并不是一个新的(Added状态)实体对象,而是在数据库中存在,但ObjectContext中未装载而已。如果不采用AttachTo方法,那么就需要从数据库中查询一次到Ob... 阅读全文
posted @ 2012-04-13 11:14 深圳大漠 阅读(1773) 评论(0) 推荐(1) 编辑
摘要:错误内容:The server has rejected the client credentials.问题:WCF客户端存在域时,客户端通过TCP调用服务器端会报告此问题。解决:设置前台和后台的NetTcpBinding:NetTcpBinding binding = new NetTcpBinding();binding.Security.Mode = SecurityMode.None;binding.Security.Transport.ClientCredentialType = TcpClientCredentialType.None; 阅读全文
posted @ 2012-04-07 17:19 深圳大漠 阅读(1015) 评论(1) 推荐(0) 编辑
摘要:错误信息The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.原因传输的消息超过了WCF默认的尺寸。解决给binding设置消息尺寸。注意,必须前后台都要设置。binding.MaxReceivedMessageSize = int.MaxValue; 阅读全文
posted @ 2012-04-01 10:20 深圳大漠 阅读(2361) 评论(0) 推荐(0) 编辑