.NET Framework Bookmark and Share   
 index > Windows Communication Foundation > System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary Error
 

System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary Error

I have a WCF service that is using the SharePoint object model to query a list. (I need my recurrence events.)

I have a Silverlight application referencing that service to display it using a datagrid.

Without referencing the sharepoint object model, everything works fine (test data). Once I start using the SPsite, SPweb, I receive:
--------------------------------------------------------
Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30618)
Timestamp: Mon, 21 Sep 2009 01:29:39 UTC
Message: Unhandled Error in Silverlight Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
at CalendarSVCApplication.TestDataRef.GetTestDataCompletedEventArgs.get_Result()
at CalendarSVCApplication.MainPage.AnonymousMethod1(Object s, GetTestDataCompletedEventArgs args)
at CalendarSVCApplication.MainPage._Lambda$__1(Object s, GetTestDataCompletedEventArgs args)
at CalendarSVCApplication.TestDataRef.TestData1Client.OnGetTestDataCompleted(Object state)
Line: 1
Char: 1
Code: 0
URI: http://localhost/TestWeb/TestPage.aspx
--------------------------------------------------------

Now, everything displays and seems to work; I'm curious what this error means. I checked the InnerException error and I was getting "servicemodel communicationexception remote server error not found" error message. I've tried to use the Web Developer Helper and all the loggin seems normal, everything is 200.

I've used Content Editor Web Part to point to my xap and display it that way and I don't seem to be getting errors there.

Is this something with permissions? I'm really at a lost and any suggestions would be grateful. Thanks in advance.
mikewiz
Now, everything displays and seems to work; I'm curious what this error means.

What do you mean, it fails only on the first attempt? It used to fail and now it does not anymore ever?

Also, it would be helpful to get the full exception message and stack trace of all InnerException in this case. Without this info, we cannot narrow the problem to a small subset of causes.
Christopher Scrosati, Software Design Engineer, WCF Silverlight, Microsoft Corp.
Christopher Scrosati - MSFT
Again, the datagrid will populate with the data and seems to work.

I've used Fiddler to try and trace the problem. At the very end of the process, 2 Responses are made to my service. One of them gets the 200 result, the other is 0 meaing no response data or the session was aborted.

When looking the innexception error I see:
-------------------------------------------------------------------
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.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result)
at CalendarSVCApplication.TestDataRef.TestData1Client.TestData1ClientChannel.EndGetTestData(IAsyncResult result)
at CalendarSVCApplication.TestDataRef.TestData1Client.TestDataRef_TestData1_EndGetTestData(IAsyncResult result)
at CalendarSVCApplication.TestDataRef.TestData1Client.OnEndGetTestData(IAsyncResult result)
at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)
--------------------------------------------------------------------

Now this doesn't happen if I use a page viewer web part in SharePoint or if I use it in a Content Editor Web Part. It happens outside of SharePoint.
mikewiz

You can use google to search for other answers

Custom Search

More Threads

• What is the right way to pass raw XML data?
• Debugging WCF Services - Really
• wcf creating problem
• Using WCF from a COM application
• Debug error: signing
• System.Runtime.Serialization.InvalidDataContractException using a ObservableCollection in a Service
• caching of security sensitive data in wcf service
• Question about multi threading
• Dataset changes the way svcutil generates proxy for Dictionary(of string, string)
• Print Channels List for Current Configuration