【问题标题】:Silverlight Entity Framework DataContractSurrogate ErrorSilverlight 实体框架 DataContractSurrogate 错误
【发布时间】:2011-05-04 16:01:57
【问题描述】:

当我的域服务被调用以返回实体框架对象时,我收到一个数据库连接超时错误。我在 Visual Studio 2010 中使用 Silverlight 4。

在执行 EntityQuery Load 操作后,初始错误被困在 Silverlight 客户端,如下所示:

“An error occurred while executing the command definition. See the inner exception for    details. 
InnerException message: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.”

我最初认为 SQL Server 数据库可能存在错误,因为错误似乎是突然出现的,但我在 Domain Service 类中发现了一个错误,如下所示:

Function evaluation timed out.
The type 'MyProject.Web.Models.MyCustomEntity' exists in both 'MyProject.Web.dll' and   'DataContractSurrogates_cfc4b316-5204-4fc6-830c-d91c6fc0b24b'

这篇文章有类似的错误,但他们的解决方案对我没有帮助: silverlight The type exists in both and DataContractSurrogates

我有点不知所措,非常感谢您的帮助!

【问题讨论】:

    标签: silverlight visual-studio-2010 entity-framework wcf-ria-services datacontractsurrogate


    【解决方案1】:

    通过将 RIA 域服务超时设置为 5 分钟的值解决了这个问题(尽管查询返回的速度比默认超时快得多)。

    仍然不确定为什么我得到了我确实得到的特定错误。并且不确定为什么查询似乎超时。这是一个几乎可以立即返回的小查询。

    我发现这个blog post 对如何设置域服务的请求超时有一个简单易懂的解释:

    Solution was increase RIA domain service timeout:

    【讨论】:

      猜你喜欢
      • 2011-10-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-05
      • 2016-09-05
      • 2015-06-21
      • 1970-01-01
      相关资源
      最近更新 更多