在点击接收/发送活动时在 xamlx 中抛出 ObjectDisposeException?
似乎 WF 运行时在点击一个“接收”和“发送”活动时试图保留其变量。
其中变量之一是实体对象。访问它时,
ObjectDisposeException
从实体设计器文件(在外键字段上)抛出
。对象实例已被释放,不能再用于 需要连接的操作。
编辑:它与实体框架中的延迟加载功能有关吗? 我之所以这么说,是因为我的实体的成员发生了异常,该成员是外键(与其他实体的关系)。
Seems that WF runtime is trying to persist its variables when hitting one Receive and Send couple activities.
One of the variable is an entity object. When accessing it, got an
ObjectDisposedException
thrown from the entity designer file, (on a foreign key field).
The object instance has been disposed and can no longer be used for
operations that require a connection.
Edit : Does it have something to do with the lazy loading funcitonnality in entity framework ?
I'm stating that because, exception occurs on a member of my entity which is a foreign key (a relation with other enity).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您延迟加载对象,请在使用它之前尝试从上下文中释放它。 (或者确保它包含在
using
语句中。)要释放,只需在上下文上调用
detach()
即可。If you are lazily loading the object, try releasing it from the context before using it. (or make sure it's wrapped in the
using
statement.)To release, just call
detach()
on the context.