【发布时间】:2010-11-11 00:41:18
【问题描述】:
我有一个 Silverlight 4 用户控件,它调用一个运行时间很长的 WCF RIA 服务。如下图,我在增加默认超时时间。
_domainContext = new WindowsDashboardDomainContext();
// Increase timeout -- this can be a very long running query
((WebDomainClient<WindowsDashboardDomainContext.IWindowsDashboardDomainServiceContract>)
_domainContext.DomainClient).ChannelFactory.Endpoint.Binding.SendTimeout = new TimeSpan(99, 0, 0);
_domainContext.GetSections( "All", "All", "All" ).Completed += GetAllSectionsCompleted;
不幸的是,它似乎忽略了这个超时,仍然抛出超时异常:
错误:查询“GetClicks”的 Silverlight 应用程序加载操作中未处理的错误失败。执行命令定义时发生错误。有关详细信息,请参阅内部异常。内部异常消息:超时已过期。在操作完成之前超时时间已过或服务器没有响应。在 System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand,CommandBehavior 行为)
为什么会这样?
【问题讨论】:
标签: silverlight silverlight-4.0 wcf