Replacing GHAs while grasshopper is running


I’ve noticed a small change in GH lately.

It used to be that when you update a GH assembly from visual studio you could drag it onto your grasshopper canvas, a window pops up warning you of ID conflicts. You click “replace all”. and your GH plugin would update instantly and replace the gha file in your components folder. This workflow was incredibly convenient as it made debugging WIP components so much faster and easier. Lately, though, this doesn’t seem to work and to replace an assembly you have to completely restart rhino and update the file in your GH Libraries folder. Is there any way around this?

I noticed this also however I think it is a windows update thing because it happens in my old Rhino versions as well. Seems Windows wont let you replace anymore while Rhino is running, it says it is in use, similar to when you try to delete a file that is currently opened.

I have had a bit of luck with Visual Studio’s edit and continue feature in recent releases. This may help

Thanks Steve. The edit and continue is definitely helpful and works when I set up a new project using the GH template. However on older project that predate the template, is there a way to get the debugger compiler to run rhino?

I’ve tried this article
that has instructions on copying this file to your VS project

I am using VS community 17

Thanks again

Never mind, tried the much simpler approach of running the program from the debugger properties and that worked.

Though, need to make sure to add this to the post-build commands to make replace the old file.
Copy “$(TargetPath)” “CLocationOfComponentsFolder$(ProjectName).gha”

Works great. As long as no other Rhino window is open. Thanks for the tip! greatly appreciated!

Also, a Rhino Command to reload grasshopper with the new version of your components is “GrasshopperReloadAssemblies”, from rhino’s command line. This will reload grasshopper, as long as GH has no open windows.Thank you to Long Nguyen/Stuttgart for this trick