Question

I have receive an Visual Studio Just-In-Time Debugger Error An Unhandled Exception("Unhandled Error in Silverlight Application Code: 4004 Category: MangedRuntimeError Message: System.ServiceMode.DomainServices.Client.DomainOperationException:

once i loaded a line of code as

Public Sub New()
InitializeComponent()
Dim context As New OrganizationContext()
context.Load(context.GetTimeTablesQuery(), AddressOf LoadMonday, Nothing)

End Sub

Private Sub LoadMonday(ByVal obj As LoadOperation(Of TimeTable))

Dim btnMonday(20) As Button
For a As Integer = 0 To 19
            btnMonday(a) = New Button()
            btnMonday(a).Height = 23
            btnMonday(a).Width = 107
            btnMonday(a).Content = timeslot(a)
            btnMonday(a).Background = New SolidColorBrush(Colors.Magenta)

            ' Sets dependency properties
            btnMonday(a).SetValue(Grid.ColumnProperty, 1)
            btnMonday(a).SetValue(Grid.RowProperty, a + 1)
            LayoutRoot.Children.Add(btnMonday(a))
        Next
End Sub

Any Idea ?

Was it helpful?

Solution

You can check that your obj has error or not by check it HasError property. If LoadOperation HasError is true you can call MarkErrorAsHandled

Example code:

' if there is an error, mark is as handled.
If (obj.HasError) Then
    obj.MarkErrorAsHandled()
End If
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top