The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
WCF Exception Handling Problems RRS feed

  • General discussion

  • Dear All,

    I have spent a lot of hours trying to solve this problem.

    I have WCF service I did consume it fine and everything is cool.

    But I was trying to handle (No Connection Error) from the windows phone 8 I couldn't since the methods in WCF client all are Async Methods.


    Ex:

     NewsWS.NewsWSClient client = new NewsWS.NewsWSClient();
                    
    client.GetMixNewsCompleted += client_GetMixNewsCompleted;
                   
     client.GetMixNewsAsync();

    After setting the [Tools => Simulation Dashboard => and set Network Simulation to no network]

    I got an exception that I cannot handle it and the application is crashed.

    Please help

    Thanks

    Sunday, July 28, 2013 12:52 AM

All replies

  • Where is your try..catch?

    http://pauliom.wordpress.com

    Sunday, July 28, 2013 7:10 AM
  • I did use the try catch but no benefit.

    try {
    
    NewsWS.NewsWSClient client = new NewsWS.NewsWSClient();
                    
    client.GetMixNewsCompleted += client_GetMixNewsCompleted;
                   
     client.GetMixNewsAsync();
    }
    catch (Exception ex)
    {
    
    }

    Try Catch will not handle error in async methods


    Sunday, July 28, 2013 12:14 PM
  • What line is reporting the error, or what is your stack trace?

    http://pauliom.wordpress.com

    Sunday, July 28, 2013 9:21 PM