문제

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 ?

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top