silverlight - 我一次又一次地遇到 LoadOperation 失败的情况

标签 silverlight silverlight-4.0 wcf-ria-services

我不知道为什么,有时加载操作成功,有时不成功。是因为同时发出了很多(6-7)个请求吗?所有 get 查询偶尔都会失败。这是错误之一:-

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; InfoPath.2; Tablet PC 2.0; .NET4.0C; .NET4.0E)
Timestamp: Wed, 16 Mar 2011 03:22:10 UTC


Message: Unhandled Error in Silverlight Application 
Code: 4004    
Category: ManagedRuntimeError       
Message: System.ServiceModel.DomainServices.Client.DomainOperationException: Load operation failed for query 'GetSiteTerms'. The remote server returned an error: NotFound. ---> System.ServiceModel.CommunicationException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound.
   at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
   at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)
   at System.Net.Browser.AsyncHelper.<>c__DisplayClass2.<BeginOnUI>b__0(Object sendState)
   --- End of inner exception stack trace ---
   at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
   at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
   --- End of inner exception stack trace ---
   at System.ServiceModel.DomainServices.Client.WebDomainClient`1.EndQueryCore(IAsyncResult asyncResult)
   at System.ServiceModel.DomainServices.Client.DomainClient.EndQuery(IAsyncResult asyncResult)
   at System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult)
   --- End of inner exception stack trace ---
   at System.ServiceModel.DomainServices.Client.OperationBase.Complete(Exception error)
   at System.ServiceModel.DomainServices.Client.LoadOperation.Complete(Exception error)
   at System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult)
   at System.ServiceModel.DomainServices.Client.DomainContext.<>c__DisplayClass1b.<Load>b__17(Object )     

Line: 76
Char: 13
Code: 0
URI: http://localhost:9090/Default.aspx

Ria服务是否不稳定或者我需要对Sql服务器的设置进行一些更改吗?

提前致谢:)

最佳答案

“未找到”异常在无用性方面排名第二,仅次于“一般保护错误”。可能有很多问题都隐藏在那个坚不可摧的“未找到”堡垒后面。

这种情况最常发生,因为 WCF 服务调用返回 HTTP 结果 4xx 或 5xx。那么,Silverlight产生的异常对调试问题没有丝毫帮助。但您不需要 Silverlight 来帮助 - 毕竟问题是服务器端的。如果启动 Fiddler,您将能够看到 Silverlight 客户端和服务器之间的流量。在那里,您还可以看到确切的服务器响应以及确切的异常消息和堆栈跟踪。

尝试使用 "How to Permanently Banish Silverlight’s “Not Found” Error for WCF Service Calls" 中的提示使 Silverlight 错误更容易接受。

关于silverlight - 我一次又一次地遇到 LoadOperation 失败的情况,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5320732/

相关文章:

xml - 如何获取 RichTextBox 的内容?

wpf - Silverlight 3 绑定(bind)到集合中的当前项

macos - Silverlight 4 macintosh 兼容性

silverlight - IIS 启动时流畅地传输低质量

entity-framework - Silverlight RIA 服务 DomainContext 的生命周期

silverlight - Silverlight WCF/RIA MVVM属性

c# - 无法分配给属性 'System.Windows.FrameworkElement.Style'(XamlParseException 未处理 :Windows Phone SDK)

android - 绘制图形多平台(IOS、WindowsPhone、Android)库

silverlight - 如何从 Silverlight 4 应用程序创建 Word 文档?

c# - WCF RIA - 不支持查询运算符 'Count'