Net Maui Android debug on Physical device

Antonio Moscati 20 Reputation points
2025-06-03T15:36:24.6533333+00:00

I should debug an android app to verify the correct functioning of the InAppBilling package by james Montemagno, as per instructions (https://jamesmontemagno.github.io/InAppBillingPlugin/TestingAndTroubleshooting.html)

I have to debug on a physical device and with a signed APK.

The device is set up for USB debugging and the Google USB drivers are installed.

The problem arises when I go to distribute the application in debug mode because I get this error:

The vsdbg debug session for project xxxx' has been stopped

In fact the app is loaded on the device but I can't debug it which instead works correctly on the emulator.(Visual studio 2022 with net8.0 - android34)

Developer technologies | .NET | .NET MAUI
0 comments No comments
{count} votes

Accepted answer
  1. Harry Vo (WICLOUD CORPORATION) 1,085 Reputation points Microsoft External Staff
    2025-08-26T07:10:02.6766667+00:00

    Hi @Antonio Moscati , thank you for reaching out on Microsoft Q&A!

    Starting with recent versions of Visual Studio 2022 (17.14+), a new “.NET Mono Debugger for MAUI apps” was introduced as a preview feature. On physical Android devices this debugger currently fails to attach correctly: the app deploys and starts, but the vsdbg session terminates immediately, which is the error you’re seeing.

    There is a related case that you can follow here

    Unfortunately, there is no solution for this issue at the moment. However, you can quickly fix this by turn this preview feature off by go to Tools → Options → Environment → Preview Features and uncheck “.NET Mono debugger for MAUI apps”. After restarting Visual Studio, debugging on a physical device should work again.


    I hope this helps you get things back on track quickly! If my suggestions can solve your issue, feel free to interact with the system accordingly!

    Thank you!

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.