开发者

thrown TargetInvocationException after calling sentiment API

开发者 https://www.devze.com 2023-04-03 03:10 出处:网络
We are developing Silverlightweb application to display the tweets on the map and analyse the tweets by using sentiment API. we used sentiment API without problems for 3 or 4 weeks. Then, we sometimes

We are developing Silverlight web application to display the tweets on the map and analyse the tweets by using sentiment API. we used sentiment API without problems for 3 or 4 weeks. Then, we sometimes faced TargetInvocationException after calling sentiment API

Now, we face TargetInvocationException after calling sentiment API more and more.

XDocument newdoc = XDocument.Parse(en.Result);

en.Result become null and

the exception is shown :

System.Reflection.TargetInvocatinException : An开发者_开发知识库 exception occurred during the operation, making the result invalid. Check InnerExcepton for exception details. ---> 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 ayncResult) at System.Net.Browser.BrowserHttpWebRequest.<>c_DisplalyClass4.b__1(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 ayncResult) at System.Net.WebClient.GetWebResponse(WebRequest, IAsyncResult result) at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result) ---End of inner exception stack trace at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary() at System.Net.DownloadStringCompletedEvent Args.get_Result() at SilverlightApplication1.MainPage.<>c_DisplayClass1a.<>c_DisplayClass23.b__16(Object ss, DownloadStringCompletedEventArgs en)


I faced this exception when I had a data contract class which had a property of type Enum. Then I decorated the DataContract with [KnownType (typeof(MyEnum))]. I did not see this exception after that.

0

精彩评论

暂无评论...
验证码 换一张
取 消