Debugging with Cursor

Hey Developers!

Does anyone have experience with debugging Rhino plugins with Cursor?

I’m contemplating switching from VS 2022 but can’t figure out how to run a live debug session targeting .NET48. netcore works fine, but netfx gives me the following error:

Both Rhino 7 and Rhino 8 with the /netfx flag fail miserably.

Any ideas?

The plugin multitargets two frameworks:

<Project Sdk="Microsoft.NET.Sdk">
	
  <PropertyGroup>
    <!-- Select the framework(s) you wish to target.
        Rhino 6: net45
        Rhino 7: net48
        Rhino 8 Windows: net48, net7.0, net7.0-windows, net7.0-windows10.0.22000.0, etc
        Rhino 8 Mac: net7.0, net7.0-macos, net7.0-macos12.0, etc
    -->
    <TargetFrameworks>net7.0;net48</TargetFrameworks>
    <EnableDynamicLoading>true</EnableDynamicLoading>
    <TargetExt>.rhp</TargetExt>
    <NoWarn>NU1701</NoWarn>
  </PropertyGroup>
  
  <PropertyGroup>
    <!-- Specifies information for Assembly and Yak -->
    <Version>1.0</Version>
    <Title>Boiler</Title>
    <Company>Boiler Authors</Company>
    <Description>Description of Boiler</Description>
  </PropertyGroup>
  
  <ItemGroup>
    <PackageReference Include="RhinoCommon" Version="8.0.23304.9001" ExcludeAssets="runtime" />
  </ItemGroup>
  
</Project>

And then in launch.json I first pre-launch Rhino, and then attach to the running process:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Rhino 8 - netcore",
      "type": "coreclr",
      "request": "attach",
      "processId": "${command:pickProcess}",
      "preLaunchTask": "launch-rhino-for-debugging"
    },
    {
      "name": "Rhino 7",
      "type": "clr",
      "request": "attach",
      "processId": "${command:pickProcess}",
      "preLaunchTask": "launch-rhino-netfx-for-debugging"
    },
  ],
  "compounds": []
}

Here is how my tasks.json looks like:

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "launch-rhino-for-debugging",
      "type": "shell",
      "command": "& 'C:\\Program Files\\Rhino 8\\System\\Rhino.exe' /netcore"
    },
    {
      "label": "launch-rhino-netfx-for-debugging",
      "type": "shell",
      "command": "& 'C:\\Program Files\\Rhino 7\\System\\Rhino.exe'"
    },
    {
      "label": "build release",
      "command": "dotnet",
      "type": "shell",
      "args": [
        "build",
        "-c:Release",
        "-clp:NoSummary",
        "${workspaceFolder}/Boiler.csproj"
      ],
      "problemMatcher": "$msCompile",
      "presentation": {
        "reveal": "always",
        "clear": true
      },
      "group": "build"
    }
  ]
}

Hello,
This may be a slightly different question.

It seems that the C# DevKit only works with VSCode now.
What debugger are you using?

I’m using this extension:

1 Like

Ey @mrhe !

I’m with the same problem right now. Did you manage to have Rhino being debugged in Cursor?

I ended up using 2 IDEs Cursor for writing code, VS2022 for debugging. Both open at the same time. Changes made in Cursor are immediately reflected in VS. Not ideal, but worked.

Yeah, this is what I’m doing right now as well.
Thanks anyway!

I don’t know for Cursor, but I occasionally use DnSpy as an external debugger. It decompiles your binaries and gives you the true and complete picture. With all advantages and disadvantages.