VB.NET plugin migration to Rhino 6


#1

Hi,
just installed Rhino 6 and tried recompiling and running a big and very important plugin I wrote in VB.NET with Rhinocommon (new reference to the rhinocommon.dll in Rhino 6 folder).
The behaviour is different, something goes wrong and I can’t apparently stop at breakpoints using Visual Studio…
Any ideas? Is there a VB.NET migrating guide as the one you provided for C/C++? (http://developer.rhino3d.com/guides/cpp/migrate-your-plugin-manual-windows/)
I need to set the plugin up and running on Rhino 6 as soon as I can :-/
Cheers
f


Migration guide for c# plugins..?
(Dale Fugier) #2

Hi @fabiopasquarell,

Most Rhino 5 plug-in that reference RhinoCommon just work in Rhino 6.

Have you tried to load your Rhino 5 plug-in in Rhino 6?

To build a true Rhino 6 version of your plug-in:

1.) Load your plug-in project in Visual Studio
2.) Modify the project settings to target .NET Framework 4.5
3.) Remove the reference to RhinoCommon and re-add it referencing the version of RhinoCommon that is included with Rhino 6
4.) Click the Build button.

– Dale


#3

Hi Dale,
thank you for the hints.
The Rhino plugin in version 5 is loaded into Rhino 6, and the compatibilty check is OK.
Anyway, the plugin does not work properly as in version 5… bad controls layout on the base panel, no auto-spawing of other needed forms on load etc.
So I tried setting the .NET framework to 4.5 (I was working on 4.6), re-applied the rhinocommon.dll from the Rhino 6 folder, gave the debug start from Rhino6.exe.
But the situation was the same. I can’t stop at breakpoints, like it somehow “misses” them.
I attach the code for the command and the plugin class, if you have some time to give it a look… panel contains a form, form contains controls… I’d like to break on the form load event to see what’s happening inside…
I can actually break on:
Protected Overrides Function OnLoad(ByRef errorMessage As String) (see code)
I can see the panel popping up on Rhino 6 but from there on, no breakpoints on the solution are effective.
Hope I explained my problem well.
Thank you!
fVisualBender.zip (2.1 KB)


(Steve Baer) #4

Does your breakpoint turn into a hollow circle :o:️ instead of a filled red circle when you attempt to debug your plug-in? If that happens, maybe Rhino is loading the wrong rhp (check your pluginmanager paths) or a pdb file is not getting created next to your rhp file when compiling.


#5

Hi Steve,
yes, I double checked rhp path and I’m using the correct one.
Breakpoint is a filled red circle (see pic).
Further investigations made me realize that the form_Load event is not fired, while the form_Shown is fired.
So I’m trying to migrate the form_load code somewhere else in order to match my needs.
It’s a bit strange, but I think I’ll manage somehow.
If you have any ideas about the missed form_load event it would help.
Cheers
f
screen


#6

Hi Dale,

I’ve tried to load my Rhino 5 plug-in in Rhino 6 but is doesn´t work. I’ve not changed the Rhinocommon, I’m using SR14…
Is it essential to change to version 6 of RhinoCommon or can it be done differently?

Thanks
Eliseo


(Dale Fugier) #7

Hi @Eliseo,

Upload your plug-in to here:

https://compat.mcneel.com/

What is reported?

– Dale


#8

Hi Dale,

The reported error is:
Error
* Assertion at metadata.c:939, condition `index < meta->heap_strings.size’ not met

Thanks


(Steve Baer) #9

It sounds like our compatibility checker may be failing with your plugin. @will, can you take a look at this?


(Will Pearson) #10

Hey @Eliseo, would it be possible to get a copy of your plug-in for testing (via private message, if you’d prefer)?


#11

Hi Will,

I’ll make a reduced version and I’ll send you the plug-in.

Thanks


(Will Pearson) #12

I’ve managed to reproduce this (logged as WWW-725). I think it has something to do with larger files getting corrupted/truncated before being passed to the compat tool.


(Will Pearson) #13

This turned out to be an issue with running the compat tool under Mono. The compat.mcneel.com server is a Linux VM running the latest version of Mono. I’ll keep an eye on things…

You can download the compat tool from the GitHub repository and run it yourself on a Windows machine. Here is an example:

Path\To\Compat.exe -q Plugin.rhp "C:\Program Files\Rhino 6\System\RhinoCommon.dll"

Assuming there aren’t any obvious error messages, search the output for any occurrences of “✗”. Please ask me if you have any questions.