C# script in ScriptEditor does not run in debugging mode with breakpoints

Hi,

I hope I am missing something very basic here.

In testing out some of my C# scripts in the Rhino 8 (8 SR15) ScriptEditor I have come across the following.

The following very simple example code runs fine when the green arrow or F5 is pressed in the script editor.

// #! csharp
using System;
using Rhino;

public class Test
{
    public static void TestMethod()
    {
        RhinoApp.WriteLine("This is a test");        
    }
}

Test.TestMethod();

However, when a breakpoint is added (to the line RhinoApp.WriteLine("This is a test");) for example, the following error is returned.

Compile Error
Keyword ‘this’ is not valid in a static property, static method, or static field initializer (Error CS0026)

As you can imagine, this makes it a lot more challenging to debug code.

I welcome suggestions as to how I can debug Rhino C# code with breakpoints in the script editor. I know I can also debug with breakpoints step by step in Visual Studio, but then I need to reload Rhino with every time I run the plugin. Script editor provides a nice intermediate step to get smaller blocks of code working before putting them into a full blown plugin.

Many thanks for your help,
Allan

Thanks for reporting this. Already fixed in 8.16.

That is great news Ehsan,

I look forward to 8.16 coming out. At least on my system, the latest update I can get is SR15

.

Hi A -

Sometimes that dialog needs restarting Rhino and/or rebooting the system.
You can just click the “Check Now…” link and manually download the current 8.16 release candidate.
-wim

Thanks Wim, your tip worked perfectly.

Sometimes that dialog needs restarting Rhino and/or rebooting the system.

Allan

1 Like