How To Debug/Recompile Without Restarting Rhino

I’ve seen a lot of threads about debugging and having to restart Rhino between sessions. I’m curious if there’s any updated tips and tricks as we knock on 2020’s door.

Have the plugin act as a shim that dynamically loads assembly -> Rebuild -> Reattach to process?
Anything with Rhino Inside?

Please check New way to load a C# .net plugin

Before I saw your comment, I was able to get a reflection shim to work. I just cloned the plugin signatures and replaced the logic with:

It works with two copies of VS open. The first has the shim project and is attached to Rhino. The second has the actual plugin. You can rebuild the actual plugin and the shim loads the fresh compile when the next command executes.

The shim could be 100% generated using a plugin’s signature to stub out the reflection calls. I’m not sure why VS is locking the obj\Debug\ files, but deleting them before loading the bin\Debug files works.

Interesting approach.

And bonus points for using F#.

I think I’m going to keep going with this approach. You don’t have to do anything special to the actual plug-in using a debugger shim.

I’ll refactor and post the shim source in c#.

Man, I am rusty. A 10 yr hiatus from programming plus a new language = 16 hrs to get hello world with uninterrupted debugging.

This works perfectly. I put a c# shim template up on github.

There’s a couple of small quirks, so I also recorded a quick YT vid.

Basically you have a shim and a normal plugin. You want to load the shim and debug it. For the normal plugin, you want to disable it in Rhino through the _PluginManager (accidentally running the normal command will prevent you from rebuilding) and unload the project in VS (force it to use the debug symbols supplied through reflection).