Xamarin-android: Xamarin Android App Not debugging (Mono.Debugger.Soft.CommandException)

Created on 11 Dec 2019  路  7Comments  路  Source: xamarin/xamarin-android

Steps to Reproduce

  1. After upgrading from visual studio 2019 version 16.3 to 16.4 the project is not able to debug but it successfully builds with no issues and errors. It keeps on producing could not connect to debugger error.
  2. The error began to appear after upgrading from API level 28 to API level 29.
  3. The issue only comes when you want to debug the application

Things already tried to fix the error:

  1. Disabling fast deployment did not work which will still bring the same error.
  2. I don't have hyper-V settings in windows 10 home to set processor compatibility for the emulators.

The message box shows the following errors:
Mono.Debugger.Soft.CommandException - debuggee returned error code INVALID_ARGUMENT
Mono.Debugging.Soft.ConnectionException - could not connect to the debugger

Expected Behavior

The android application should debug as normal with visual studio.

Actual Behavior

An error message with could not connect to debugger is displayed when debugging on both emulator and physical android device.
Emulator API level 27 and 28 produce the same error
Physical device API level 22 produce the same error (Samsung Galaxy Grand Prime)

Version Information

Xamarin Android SDK 10.1.1.0 (d16-4/f2c9364)
Minimum app version api level 19
Target app version api level 29

Log File

A brief summary of the log file collected by the xamarin diagnostics

Log for Emulator API level 27
Log for Grand Prime
Any help on solving the issue will be appreciated.

regression

Most helpful comment

Any news on this. Have exactly the same behaviour in VS2019 professional 16.4.1

All 7 comments

Any news on this. Have exactly the same behaviour in VS2019 professional 16.4.1

The team is tracking this issue on Visual Studio Developer Community:

https://developercommunity.visualstudio.com/content/problem/842376/android-debugging-not-working-in-latest-release-16.html

The discussion on that item includes a .vsix file with a candidate fix you can try if you like, or if you prefer, you can work around the issue for now by navigating to Debug > Windows > Exception Settings, right-clicking Common Language Runtime Exceptions, and selecting Restore Defaults:

image

Thank you so much @brendanzagaeski for your support. The solution for resetting the CLR Exceptions to default setting helped to clear the error.

Thanks @brendanzagaeski it worked for me too.

Release status update

A new Release version has now been published that includes the fix for this item.

Fix included on Windows in Visual Studio 2019 version 16.4.2. To get the new version that includes the fix, check for the latest updates or install the latest version from https://visualstudio.microsoft.com/downloads/.

Thanks again for the report!

the issue is still happening in Microsoft Visual Studio Community 2019
Version 16.7.7. :(

@yusufmsalh, thanks for the information. I suspect the underlying cause of the issue you are seeing is something a little different from what was happening back on this older issue last year. When you get a chance, I'd recommend submitting a new feedback item via Report a Problem in Visual Studio so the team can take a look. On the new feedback item, be sure to include the full error message you are seeing. Thanks in advance!

Was this page helpful?
0 / 5 - 0 ratings