VSCode Debug Project on Mac - What's the magic?

Hi there!

I’ve been giving a shot to this fantastic Mono Debug VSCode extension you created :heart: It works great, but sadly VSCode is still miles away from Rider.

I pinged on this thread Debugging with JetBrains Rider a while back, but I finally had time to gather my thoughts.

I’ve been looking through the code to see if I would be able to translate this into a Rider configuration so that I could launch and debug my Grasshopper plugins on Rider for Mac instead.

As far as I’ve been able to gather, there isn’t much happening on the Debugger side of things, so I was hoping you’d be able to shed some clarity on this.

What I’ve gathered so far:

You’re using your own clone of mono-debug with minimal changes, mainly centred around setting some obscure env vars that will affect both rhino and the debug process:

RHINO_SOFT_DEBUG with a value of transport=dt_socket,server=y,address={host}:{port}
MONO_ENV_OPTIONS with a value of --debug --debugger-agent=transport=dt_socket,server=y,address={host}:{port} or alternatively pass the args to the debugger itself.

In addition, the launch configuration also requests to add RHINO_PLUGIN_PATH and GRASSHOPPER_PLUGINS, which don’t seem to be used in the Debugger project so I’m guessing they’re directly picked up by Rhino. Could you confirm this?

I have tried manually setting these env vars with matching host and port values in my Rider configurations but without success. Is it possible I’m missing some extra needed step to make this work?

Would appreciate any guidance (and would be happy to report back if I make it work)


ping @curtisw @Alain

1 Like

@curtisw @Alain

Can I bump this too? I can’t even seem to get vscode-rhino-debug to launch Rhino 7.app (having built and installed the vsix locally, and using launch.json specs as given).

(NB it’s warning that a "program" property is missing in the launch.json config…)

Can we get some better documentation or debugging-of-the-debugger potentially?

And echoing @alan2, using Jetbrains Rider for Rh/Gh on macOS to develop and debug is miles ahead of VSCode, if it is possible to get that going…

Hi @daniel.fink,

On the Mac, use Visual Studio 2022 and the Rhino Visual Studio (mpack) extension.

– Dale

Thanks @dale
I’m not sure the debugger is working. I’ve followed Rhino - Your First Component (Mac) (assuming it works the same way for Visual Studio as for Xamarin) and I don’t seem to hit any breakpoints…

Hey @dale!

Thanks but that workflow is exactly what we want to run away from. VS for Mac is so bad that I’d be willing to put in my own time to develop a Rhino debugger strategy for Rider Mac, but I can’t seem to startup Rhino in a way that the debugger in Rider will successfully attach.

I suspect I’m just missing some key pieces of information on how both Debugger and Rhino.exe have to be initialised for everything to work,

and it is surely related to this :point_down:t3:

If I could get some clarity on this regard, I’d be happy to go for it and share it back.

Just for clarity:

Right now, I develop all my Grasshopper plugins on a Mac, running Windows on Parallels and debug Rhino in Windows using Rider for Windows, and this works so well that I only use VS Mac to double-check everything in Mac still works, I rarely debug at all on mac unless I really need to, and that’s only due to VS Mac (and VSCode C# engine) lacking in many basic features.

Anyhow, that’s not to substract from the great job that you guys have done on VSCode :raised_hands:t3: it’s pretty amazing, but still, Rider literally kicks ass as C# IDE’s go. :slight_smile:

Hey @alan2 ,

I just got a mac and tried VS for Mac, I concur it feels like a second class citizen compared to VS Windows. Especially lacking hot reload. They seem to be discontinuing it, favouring VS Code. I too have gotten VS Code to work nicely. But prefer a fully fledged IDE such as Rider, especially for features such as code coverage and unit tests.

I have gotten Rider to work really nicely on Mac for debugging etc. I’ll explain how I did it tomorrow when I have my Mac infront of me. If I forget. Please ping me.

– cs

1 Like

This is my setup in Rider for Rhino 8

And the project settings;

	"profiles": {
		"Crash (Mac Rhino 8)": {
			"commandName": "Executable",
			"executablePath": "/Applications/Rhino 8.app/Contents/MacOS/Rhinoceros",
			"hotReloadEnabled": true

Nice @csykes!

I notice you’re running RhinoWIP. Does this also work for you in the existing Rhino 6/7?

I remember setting this executable for Rhino7 and getting an error when trying to launch, complaining it wasn’t a valid executable. Could be related to the fact that Rhino8 now uses modern .NET, while the prior versions use net framework :thinking:

Anyhow… thx again! you made my day.

1 Like

Glad it works @alan2!

I had a quick try with Rhino 7, but no luck. If this is important to you I can have a poke around and try to find a solution :blush:.

Make sure you update this slightly for the new Rhino Beta release!

	"profiles": {
		"Crash (Mac Rhino 8)": {
			"commandName": "Executable",
			"executablePath": "/Applications/RhinoBETA.app/Contents/MacOS/Rhinoceros",
			"hotReloadEnabled": true

To be honest… I’m happy with “this only works with Rhino 8 and onward” and never looking back :rofl:

Thanks a lot! :heart:


@dale @curtisw @Alain

Have there been any updates on this? Visual Studio for Mac is retiring in August. If the mono debugging tool referenced by @alan2 is the future, I will start transitioning to it. Otherwise, it would be nice to know if/how Macs will be supported moving forward.

Hey @Kendrick_Shepherd,

Yes, the vscode-rhino-debug extension is the recommended solution to debug Rhino 7 on Mac going forward.

To debug Rhino 8, you would use the C# extension’s coreclr debug type.

Hope this helps.


Thanks, @curtisw. I have spent many hours cleaning .sln and .csproj files into formats that can be read and compiled in VSCode. All of the code for my plugins now compile (to *.dll files, whose extensions are then manually changed to *.gha files).

While these plugins are recognized by Rhino 8 for Mac, I am unable to get debugging functionality working using either the vscode-rhino-debug extension listed or the C# extensions (and Developer Tools) for Rhino 8. I have used the launch.json referenced in vscode-rhino-debug (after installing Mono and npm using HomeBrew), but the “type: rhino” cannot be found. Similarly, I have installed the RhinoCode extension on VSCode and revised the path to be “rhinocode.rhinoInstallPath”: “/Applications/Rhino\ 8.app” in settings.json. However, the “Rhino: Run in Rhino WIP” also fails.

Finally, creating the default Grasshopper project from VS 2022 for Mac and then directly opening it in VS Code and running also fails to debug. There must be something that I am missing…

@dale, @Alain, @curtisw, could you please provide more guidance on how to transition to VS Code (e.g. by providing a sample working solution)? I, like @daniel.fink, am still struggling to make this transition.

Hey @Kendrick_Shepherd,

To debug Rhino 8 in VS Code, you use the coreclr debug type, not rhino. You also do not need to install mono nor npm for debugging in VS Code for Rhino 7 or 8.

I’ve created a “master of all samples” that shows how to create a multi-targeting Rhino plugin and Grasshopper component (with access to System.Windows.Forms), including VS Code configurations and VS for Windows launch profiles for both Rhino 7 and 8, which you can download here:

MyMultiTargetedPluginWithGrasshopper.zip (32.4 KB)

We hope to make this more streamlined in the near future, but for now hopefully this sample helps get you what you need.

VS for Mac is officially being retired, so VS Code is your best bet going forward.


1 Like

For future readers, I’ve updated the docs here, any issues let me know and I’ll update them.

Thanks for the update! I am wondering what I should do now if I am developing a cross-platform plugin. Should I use VS for Windows and VS code for Mac? Are there any updates on how to set up a cross-platform plugin?

You can use VS Code on mac and either VS Code/VS on Windows.

I will update the Cross Platform PlugIn guide soon, and likely there will be a simple one, and a more complex one :slight_smile: .
You can also in theory follow the Plugin for mac guide and it should work nicely on windows (although I haven’t tetsted that)

1 Like

I personally use VS on Windows and VS Code on Mac