Visual Studio 2017 studio showing error 'This application is in break mode' and throws unhandled exception

24,413

Solution 1

I'm surprised yet not best answer posted for this issue. For me above solutions didn't work. To resolve this issue, I'd to disable following option from debug menu.

Debug > Options > General > Uncheck "Enable Just My Code"

For more details, check microsoft msdn help.

Solution 2

You should be getting exception details and a call stack, which will greatly aid in your debugging efforts. I think this is a bug with Xamarin on VS2017 right now.

Solution 3

I ran across this error and looked in the output window after the application failed. In my case I had a method in a view model class with a "Task" that is invoked by the XMAL.

Share:
24,413
Admin
Author by

Admin

Updated on January 05, 2020

Comments

  • Admin
    Admin over 4 years

    I am developing a Xamarin.Android app. Whenever i try to download a JSON feed I get the error "Your app has entered a break state, but there is no code to show because all threads were executing external code".

    Here's the screenshot of error Here's the screenshot of error

    • My json feed download code

       string url = "http://xamdev.epizy.com/getData1.php";
      
       public async void downloadJsonFeedAsync(String url) {
          var httpClient = new HttpClient();
          Task<string> contentsTask = httpClient.GetStringAsync(url);
      
          // await! control returns to the caller and the task continues to run on another thread
          string content = await contentsTask;
          Console.Out.WriteLine("Response Body: \r\n {0}", content);
      
          //Convert string to JSON object
          result = Newtonsoft.Json.JsonConvert.DeserializeObject<RootObject> (content);
      
          //Update listview
          RunOnUiThread (() => {
              listView.Adapter = new CusotmListAdapter(this, result.posts);
              progress.Visibility = ViewStates.Gone;
          });
      }
      
    • i have got error at this line

      string content = await contentsTask;

    • This is my json

      { "posts":[ { "id":"1", "url":"", "title":"Convert Speech to Text in Android Application", "date":"2017-06-16 06:15:18", "content":"Convert Speech to Tex Convert Speech to Text in Android Application Convert Speech to Text in Android Applicationt in Android Application", "thumbnail":"http:\/\/stacktips.com\/wp-content\/uploads\/2017\/01\/Speech-to-Text-in-Android-375x300.jpeg" } ] }

    Please can anybody tell me whats wrong with my code ? Thanks in advance..

    Here's my php webservice code-

    <?php 
    
    if($_SERVER['REQUEST_METHOD']=='GET'){
    
        require_once('conn.php');
    
        $sql = "SELECT * FROM space";
    
    
        if ($result = mysqli_query($conn, $sql))
         {
          $resultArray = array();
          $tempArray = array();
    
    
           while($row = $result->fetch_object())
           {
    
             $tempArray = $row;
              array_push($resultArray, $tempArray);
          }
    
    
        echo json_encode(array("result"=>$resultArray));
        }
            mysqli_close($conn);
    
         }
       ?>