RIA服务初始化问题
我在使用 RIA 服务时遇到问题。有时(并非总是)我收到 InvalidOperationException 并显示消息:“EntityTypes 已被初始化”
该错误来自生成的文件,但我不知道如何解决此问题。谷歌只给出了 2 个结果,这不是很有帮助。
有谁知道我可以做什么来解决这个问题或者我可以尝试什么?
问候
I have a problem with RIA services. Some times (not always) I get an InvalidOperationException with the message: "EntityTypes has already been initialized"
The error comes from the generated file but I don't know how to resolve this issue. Google brings out only 2 results which are not very helpfull.
Does anybody know what I could do to solve this or what I could try?
Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我现在找到了解决方案。
设置断点后,我注意到我从不同的线程调用了两次相同的方法。
我的理论:他们同时访问相同的域服务查询,但由于某种原因这是不可能的。这也解释了因为此错误只是偶尔发生。
由于我修改了代码,因此该方法不会被调用两次,一切都运行良好。
希望这对某人有帮助...
I found now a solution.
After setting a breakpoint I noticed that I called two times the same method from different threads.
My theory: they accessed the same Domain Service query at the same time and this is for some reason not possible. This explains also because this error happens only sporadically.
Since I modified my code that this method is not called two times everything works perfectly.
Hope this helps someone...