0

I am attempting to add smart exception handling to a Silverlight 4 RIA application that is primarily consumed out-of-browser.

My goal is to display a meaningful error window if RIA services are not currently accessible (e.g. The server is down for maintenance)

Is there any facility built into RIA/SL for this task?

jhappoldt
  • 2,406
  • 1
  • 21
  • 24

1 Answers1

0

I use the following to check to see if my user has network access which may get you the answer you are looking for.

Private Sub CheckMode()
    If Application.Current.IsRunningOutOfBrowser Then
        currentMode.Text = "Operating Mode: Out of Browser"
    Else
        currentMode.Text = "Operating Mode: In Browser"
    End If
    currentMode.Foreground = New SolidColorBrush(Colors.White)
End Sub

Private Sub UpdateNetworkIndicator(ByVal sender As Object, ByVal e As System.EventArgs)
    If WebContext.Current.User.IsAuthenticated Then
        If NetworkInterface.GetIsNetworkAvailable Then
            connectionStatus.Text = "Network Status: Connected"
            connectionStatus.Foreground = New SolidColorBrush(Colors.Green)
        Else
            connectionStatus.Text = "Network Status: Disonnected"
            connectionStatus.Foreground = New SolidColorBrush(Colors.Red)
        End If
    End If
End Sub
Stryder
  • 795
  • 2
  • 9
  • 20
  • I am looking for a way to ensure that the web server/RIA services are online, regardless of end-user network status. – jhappoldt Sep 03 '10 at 15:34
  • I never considered the possibility that my server would not be online. I would guess your best bet would be to make a call and trap the error, other than that I don't know. Sorry I could not be of more help. – Stryder Sep 07 '10 at 22:19