0

I have a problem in JetBrains Rider with .Net Console Application. It just goes out of Debugging mode. I'm using macOS Catalina 10.15.4.

    public static void Main(string[] args)
    {
        var num1 = new Number(20, string.Empty);

        var number = num1.Amount;

        // (...)

    }

I've set a Breakpoint on the first curly bracket (in Main class) and run the Debugger. Using 'Step Over' it goes normally to the var num1 = new Number(20, string.Empty); line, and then, in the var number = num1.Amount; it just stops. I've checked the console and it says:

=================================================================
        External Debugger Dump:
=================================================================
(lldb) command source -s 0 '/tmp/mono-gdb-commands.25146'
Executing commands in '/tmp/mono-gdb-commands.25146'.
(lldb) process attach --pid 25146
error: attach failed: Error 1

I don't know what to do with that. Debugger works totally normal when is attached to external process, like when I'm working with Unity.

Not sure if it's needed, but here's my Number class:

public class Number
    {
        public float Amount
        {
            get => amount;
            set => amount = value;
        }

        public string Unit
        {
            get => unit;
            set => unit = value;
        }

        private float amount;

        private string unit;

        public Number(float amount, string unit)
        {
            this.amount = amount;
            this.unit = unit;
        }

        public override string ToString()
        {
            return string.Format("{0} {1}", amount, unit);
        }
    }
sjk
  • 111
  • 8
  • There's nothing wrong with your code, so it could be a Rider issue. Have you tried rebooting the computer? – DavidG Apr 03 '20 at 11:44
  • Side note: You should use auto properties, they are much easier to read and far less boilerplate code required. For example: `public string Unit { get; set; }` – DavidG Apr 03 '20 at 11:44
  • @DavidG Sure, thanks for the advice. I even restarted the computer and nothing changed. I think I have to recreate whole app from the scratch and try again. – sjk Apr 03 '20 at 11:54
  • I was able to quickly get the screenshot of the exception saying "Exception of type 'Mono.Debugger.Soft.VMDisconnectedException'" – sjk Apr 03 '20 at 12:05
  • Is this all of your code that you are showing? What is the next line? – DavidG Apr 03 '20 at 12:11
  • I actually changed this a bit and now whole Main function looks like: `var num1 = new Number(20.0f, string.Empty);` `Console.WriteLine(num1);` Error occurs on Console.WriteLine – sjk Apr 03 '20 at 12:16
  • It says that `num1` is unknown type in the Variables window. Maybe the problem is I've updated my Catalina version a few days ago and they weren't prepared for that update. – sjk Apr 03 '20 at 12:19
  • 1
    Only thing I can suggest is to make sure Rider is updated too. – DavidG Apr 03 '20 at 12:20
  • Update worked. Thanks for helping me out! – sjk Apr 03 '20 at 12:29

0 Answers0