title: facebook loginbutton sdk in c# crashing application
body: <p>I need a small help
  I have created a small physioit app for windows phone 8.</p>
  
  <p>I have added facebookclient loginbutton in my xaml file.
  Now when there is no data connection in my phone and when I run the code, it gives me <code>TargetInvocationException</code> and my app crashes.</p>
  
  <p>Here is the exception I am getting –</p>
  
  <pre><code>innerException 
  {Facebook.WebExceptionWrapper: The remote server returned an error: NotFound. ---&gt;
        System.Net.WebException: The remote server returned an error: NotFound.
   at System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
   at System.Net.Browser.ClientHttpWebRequest.&lt;&gt;c__DisplayClasse.&lt;EndGetResponse&gt;b__d(Object sendState)
   at System.Net.Browser.AsyncHelper.&lt;&gt;c__DisplayClass1.&lt;BeginOnUI&gt;b__0(Object sendState)
  --- End of inner exception stack trace ---}           
  
  System.Exception     {Facebook.WebExceptionWrapper}
  </code></pre>
  
  <p>How can I catch this exception?</p>
  
  <p>I am using the facebook sdk to create the loginbutton</p>
  
  <p>Here is the code snippet</p>
  
  <pre><code>&lt;facebookControls:LoginButton
      x:Name="loginButton"
      Grid.Row="2"
      Margin="5"
      HorizontalAlignment="Right"
      FetchUserInfo="True"      
      ApplicationId="xxxxxx" 
      SessionStateChanged="OnFacebookSessionStateChanged"
      UserInfoChanged="OnFacebookUserInfoChanged"
      AuthenticationError="LoginButtonAuthenticationError" /&gt;
  </code></pre>
  
  <p>Can you please help me out.</p>