Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8539199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:18:26+00:00 2026-06-11T11:18:26+00:00

I have a Silverlight 5 application accessing a server using SignalR. Most of the

  • 0

I have a Silverlight 5 application accessing a server using SignalR. Most of the times this works fines but now and then when running in debug I get an error during negotiation. I’m thinking that this may be because my local ISS installation runs out of connections.

Anyway, when this occurs, the Unhandled Exception handler in my application is called. I want to change this, so that I can handle the exception local to the initialization of SignalR. I don’t want the negotiation error to propagate to my central error handler.

I have a piece of code which looks as follows:

     var uri = Application.Current.Host.Source.GetComponents(UriComponents.Scheme | UriComponents.HostAndPort, UriFormat.Unescaped);

     _hubConnection = new HubConnection(uri);
     var hub = _hubConnection.CreateProxy("stuffhub");
     hub.On<Stuff>("Stuff", message => DoStuff());

     var transport = new LongPollingTransport();
     _hubConnection.Start(transport);

This code executes fine most of the time, but some times the following exception is handed to my central unhandled excpetion handler a few seconds after the code above has executed.

Message: Exception(s) occurred : .
[ Exception(s) occurred : .
[ Exception(s) occurred : .
[ Exception(s) occurred : .
[ System.InvalidOperationException: Server negotiation failed.
   vid SignalR.Client.Transports.HttpBasedTransport.<GetNegotiationResponse>b__0(IResponse     response)
   vid SignalR.TaskAsyncHelper.FromMethod[T1,TResult](Func`2 func, T1 arg) ]
 ]
 ]

]

The StackTrace of the ApplicationUnhandledExceptionEventArgs is:

 at System.Threading.Tasks.Task.Finalize()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T11:18:28+00:00Added an answer on June 11, 2026 at 11:18 am

    Like Jon Skeet said, you need to handle the exception from the task returned from Start().

    var uri = Application.Current.Host.Source.GetComponents(UriComponents.Scheme | UriComponents.HostAndPort, UriFormat.Unescaped);
    
     _hubConnection = new HubConnection(uri);
     var hub = _hubConnection.CreateProxy("stuffhub");
     hub.On<Stuff>("Stuff", message => DoStuff());
    
     _hubConnection.Start().ContinueWith(task => 
     {
         if(task.IsFaulted) {
             Debug.WriteLine("Error starting -" + task.Exception.GetBaseException());
         }
     });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am accessing Sharepoint web services from a Silverlight application, I have put the
I have a Silverlight application communicating with the server side through WCF services. Initially
I have a Silverlight application on the client communicating with the server side through
I have a Silverlight application that is using a DataGrid. Inside of that DataGrid
The scenario: I have a PRISM application developed in Silverlight (4), and I'm using
I have Silverlight application using NHibernate as a ORM. I have projects for Data(mapp
I have silverlight 4 application with PRISM 4, I'm using MEF. My Shell defines
I have a Silverlight application where I have styled my listboxes. This is a
I have a Silverlight application for Windows Phone 7. This application runs fine, except
I have a silverlight application which works perfectly and can access the WCF services

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.