Hi i have a WPF application that uses a service reference to a web service...
Now i have a GUI component that tracks the progress of this...
But i seem to have some sort of bug here, it only occurs on some machines and not often.. I start a call with MethodNameAsync and display the progress bar until the matching Completed event occurs.
some times i call 3 different async methods in a row but only the two of them get their Completed event raised so the GUI will be locked and the application has to be restarted.
After being totally frustrated a few weeks i found the event AppDomain.CurrentDomain.FirstChanceException, so i hooked up to it and started logging all FirstChanceExceptions..
Before the second event is raised a System.Net.Sockets.SocketException "An invalid argument was supplied" is thrown and after that a System.ObjectDisposedException "Cannot access a disposed object." is thrown both are first chance exceptions..
i guess my wcf client forgets about the third method call when this happens but my loading indicator does not..
So is this a known bug or am i missing some thing?
Edit code as requested:
mCheckInService = New CheckInServiceClient()
AddHandler mCheckInService.GetPersonActivitiesCompleted, AddressOf CheckInService_GetPersonActivitiesCompleted
AddHandler mCheckInService.GetPersonArticlesCompleted, AddressOf CheckInService_GetPersonArticlesCompleted
AddHandler mCheckInService.GetPersonImageCompleted, AddressOf CheckInService_GetPersonImageCompleted
Dim workItem As WorkItem = Context.WorkDisplayService.AddWorkItem(Me, Resources.Label.DownloadingPersomImage)
mCheckInService.GetPersonImageAsync(Context.Session, person, workItem)
workItem = Context.WorkDisplayService.AddWorkItem(Me, "Hämtar aktiviteter")
mCheckInService.GetPersonActivitiesAsync(Context.Session, Person, workItem)
workItem = Context.WorkDisplayService.AddWorkItem(Me, Resources.Label.DownloadingPersonArticles)
mCheckInService.GetPersonArticlesAsync(Context.Session, person, workItem)
Private Sub CheckInService_GetPersonActivitiesCompleted(ByVal sender As Object, ByVal e As GetPersonActivitiesCompletedEventArgs)
Dim workItem As WorkItem = CType(e.UserState, WorkItem)
If (Context.WorkDisplayService.FinishWorkItem(Me, workItem)) Then
Private Sub CheckInService_GetPersonArticlesCompleted(ByVal sender As Object, ByVal e As GetPersonArticlesCompletedEventArgs)
Logger.Trace("CheckInService_GetPersonArticlesCompleted()")
Dim workItem As WorkItem = CType(e.UserState, WorkItem)
If (Context.WorkDisplayService.FinishWorkItem(Me, workItem)) Then
Private Sub CheckInService_GetPersonImageCompleted(ByVal sender As Object, ByVal e As GetPersonImageCompletedEventArgs)
Logger.Trace("CheckInService_GetPersonImageCompleted()")
Dim workItem As WorkItem = CType(e.UserState, WorkItem)
If (Context.WorkDisplayService.FinishWorkItem(Me, workItem)) Then
Its GetPersonActivitiesAsync that never gets completed..
Edit:
Fix this temporary by not using async methods and instead using a thread that will call them one by one.. now this is not a elegant solution, i should be able to use the async methods...