Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>For whatever reason, it looks like the remote web server is responding with 404 Not Found. Maybe the server is doing the right thing. If so, you're application is going to need to deal with this response in a sensible way. Maybe it isn't doing the right thing, and you have a bug in your server component to fix. :-)</p> <p>I'd approach solving the application crash in two different ways.</p> <p>First, let's handle this error so the application doesn't crash. As an example, we'll just populate the <code>resultText</code> control with some details about the error. As we have no details about what the request is supposed to do or what the response looks like, there isn't much more robust error handling that can be discussed right now. Keep in mind that networks calls don't always work, so you're going to need some error handling even if you address the second point, below.</p> <pre><code>private async void buttonStringGet_Click_1(object sender, RoutedEventArgs e) { JsonWebAsync.JsonWebClient client = new JsonWebAsync.JsonWebClient(); string result; try { var resp = await client.DoRequestAsync("myurl"); result = resp.ReadToEnd(); } catch (WebException ex) { // generic error handling result = string.Format("Could not get data. {0}", ex); } resultText.Text = result; } </code></pre> <p>Second, let's try to avoid the error in the first place. Let's make sure the request the client is sending makes sense. You could add some instrumentation code to make sure that whatever gets used instead of "myurl" is sensible.</p> <pre><code>private async void buttonStringGet_Click_1(object sender, RoutedEventArgs e) { JsonWebAsync.JsonWebClient client = new JsonWebAsync.JsonWebClient(); string requestUrl = ComputeRequestUrl(); // I assume this code exists somewhere. System.Diagnostics.Debug.WriteLine("Sending request for {0}", requestUrl); var resp = await client.DoRequestAsync(requestUrl); string result = resp.ReadToEnd(); resultText.Text = result; } </code></pre> <p>Now, when you run a debug build with a debugger attached, you should be able to see the tracing output in the Output window of Visual Studio when you pick the Debug stream.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload