随机“未找到"; Silverlight访问ASP.NET Web服务时出错 [英] Random "Not Found" error with Silverlight accessing ASP.NET Web Services
问题描述
我正在使用Silverlight 3和ASP.NET Web服务开发一个应用程序,该应用程序使用Linq to SQL从SQL Server数据库中获取数据.
I'm developing an application with Silverlight 3 and ASP.NET Web Services, which uses Linq to SQL to get data from my SQL Server database.
随机地,当用户使操作从我的任何Web服务方法获取信息时,Silverlight都会引发类型为"CommunicationException"的异常远程服务器返回了一个错误:NotFound.",其InnerException状态为"System" .Net.WebExceptionStatus.UnknownError".
Randomly when the user causes an action to get information from any of my web service methods, Silverlight throws the exception "The remote server returned an error: NotFound.", of type "CommunicationException", with the InnerException status of "System.Net.WebExceptionStatus.UnknownError".
几乎10%的请求都会收到此错误.如果用户尝试再次获取相同的信息,则通常请求没有错误,并且用户获取了数据.
Almost 10% of requests gets this error. If the user tries to get the same information again, normally the request has no errors and the user gets the data.
在Visual Studio中调试时,只有Silverlight会停止运行,并且我看不到找不到Web服务的原因.
When debugging in Visual Studio only Silverlight stops on the exception, and I see no reason for the web service not being found.
推荐答案
如果碰巧正在使用WCF Web服务,则可以尝试在web.config文件中打开WCF跟踪:
if you happen to be using WCF web services, you might try turning on WCF Tracing in your web.config file:
<configuration>
<system.diagnostics>
<sources>
<source name="System.ServiceModel"
switchValue="Information, ActivityTracing"
propagateActivity="true">
<listeners>
<add name="traceListener"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData= "c:\CodePlex.Diagnostics\CodePlex.Diagnostics.Services.Web.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
</configuration>
For context and details: READ ME!
这篇关于随机“未找到"; Silverlight访问ASP.NET Web服务时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!