我有一個Silverlight 4用戶控件,它調用一個運行時間很長的WCF RIA服務。如下所示,我正在增加默認的超時時間。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;
不幸的是,它似乎忽略此超時,仍然拋出超時異常:
Error: Unhandled Error in Silverlight Application Load operation failed for query 'GetClicks'. An error occurred while executing the command definition. See the inner exception for details. Inner exception message: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
這究竟是爲什麼?