locked
Debugging Mono apps from Visual Studio RRS feed

  • Question

  • hi,

     I am looking at debugging a mono app running on Linux, via Visual Studio.

    I looked at VS2017, which includes Xamarin, and what i see is that if I create a simple Android APP, with C# code, i am able to debug the C# code from the VS2017 IDE, with the code running on the Android Simulator (Running on QEMU). So, that leads me to believe that VS2017 has all that is required to debug a Mono app. However, I don't see a way to debug a Mono app directly. 

    Here is what i am doing:

    1. Building a C# app using MS VS2017. I use microsoft compiler to build the code. 

    2. I deploy the binary to Linux, and use Mono to run it. 

    Since Mono run-time is very close to the .NET framework run time, I am able to run it well enough, but unable to attach a debugger. Any help will be very appreciated!

    Some more notes:

    1. I am able to debug (including adding breakpoints) using VS Code with a plugin (Mono Debug) via the target IP address and Mono' Runtime's --debug option. 

    2. I am able to debug using Xamarin Studio via the target IP address and Mono Runtime's --debug option. 

    What i would like is to be able to do the same with Visual Studio. 

    Tuesday, August 22, 2017 7:10 AM

All replies

  • Hi DeepakSes,

    Please install MonoRemoteDebugger for your Visual Studio 2017 which enables linux remote debugging using Visual Studio 2017. You could download and install it from below link.

    https://marketplace.visualstudio.com/items?itemName=Bongho.MonoRemoteDebugger

    Then follow the steps described in following link to let in work with your Visual Studio 2017.

    https://github.com/techl/MonoRemoteDebugger

    Best Regards,
    Weiwei


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, August 23, 2017 2:04 AM
  • Weiwei,

      Thanks for your response. I did try this option too and it seems to work quite well for single threaded applications but when i have a multi threaded application, the debugger seems to work only for the main thread.

    For instance, if i have a break point on the main thread, the debugger recognizes the break point and stops the execution, and allows me to watch the thread stack, and the local variables etc. However, if there is a breakpoint on a thread other than the main thread, the debugger stops the execution when the breakpoint is hit (which is good) but does not show the call stack nor allows to watch variables (which is not so good).

    So, the search continues... Any other suggestions? 

    Thanks,

    Deepak

    Wednesday, August 23, 2017 3:31 PM
  • Hi Deepak,

    After searching in Visual Studio Tools -> Extensions and Updates, I don't find any other better Mono debugger tools for Visual Studio. So I submit a feedback for MonoRemoteDebugger tool.

    https://marketplace.visualstudio.com/items?itemName=Bongho.MonoRemoteDebugger#review-details

    And as far as I know, Xamarin Studio is support debug Mono apps. Please try use it debug your Mono app before there has better tools for Visual Studio.


    Best Regards,
    Weiwei

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Weiwei Cai Tuesday, August 29, 2017 2:29 AM
    Thursday, August 24, 2017 1:52 AM
  • You may have a look at MDebug (https://www.mdebug.com/), it supports multithreaded application and is much more powerfull and integrates fully into Visual Studio. 
    Tuesday, September 19, 2017 8:50 PM
  • Sorry to dig up this old thread, but according to mdebug.com they only sell to EU companies and the cost is 600+ euros per seat.  Ouch, not really an option for most of us unless they have a community edition.

    At one point I thought mdebug was open source?

    Saturday, February 17, 2018 5:25 PM
  • This Visual Studio plugin worked fine for me https://marketplace.visualstudio.com/items?itemName=GordianDotNet.VSMonoDebugger0d62

    The plugin is new, so not yet as popular as it should be.

    Friday, April 6, 2018 5:26 AM