I have a Windows.System.Forms.Form which displays in Rhino6 and Rhino7 as the exactly size as is displayed in the Visual Studio designer. However the same plugin code shows this form in Rhino8 about 10% larger (so the widget sizes are not the same as in Rhino7). Is this a Rhino8 bug? Is there a work-around please?
Yes @dale - the plugin already scales for this. The issue is that on Rhino7 the Form shows as per Visual Studio, whereas on Rhino8 on the same PC it shows slightly larger.
@dale - if I run Rhino8 from WITHIN Visual Studio (using the â/nosplash /netfxâ command line arguments), the picture box is the CORRECT size. But if I then run from the Windows desktop, it is incorrect. So I cannot even debug this in the Visual Studio debugger, since it works correctly from there.
This means Rhino 8 starts with the default /netcore, which is different from what you use to debug. Remove the /netfx from your debug target to get the same behavior in Visual Studio.
Thanks @nathanletwory . I really appreciate the help. However I am not sure that answers my original question. For clarityâŚwhen I run Rhino8 from the desktop (presumably .NET Core), the dialog widgets are not the same size as specified in Visual Studio.
Would it be possible to get some assistance from the Rhine devs please? It looks to me to be a Rhino8 bug. I have even tried setting the MinimumSize and MaximumSize of the System.Windows.Forms.PictureBox, and it still displays as a larger size.
Any news on this from the Rhino devs please? It is a serious issue for my plugin. I have tried upgrading the project to .NET 7, and then tested it in Rhino8 and the problem persists. I need to get this sorted out please.
To debug using .NET Core with your .NET 4.7 project you must either multi-target your plugin project or create a .NET 7 launcher project, which is outlined here.
As for the different behaviour, this is likely due to the changes in Windows Forms in which might not behave the same in every way. You will need to update your code to account for these changes. If there are any bugs with Windows Forms, they can be reported on the winforms GitHub repo.
I have spent a huge amount of time on this, and been unable to resolve the core issue. I have upgraded the plugin to .NET 7 in VS2022 and in the form editor, the .NET7 version of the plugin shows larger widget sizes than in the .NET4 version - and for System.Windows.Forms.PictureBox widget no amount of hacking or tweaking settings will change the size (the other widgets are fine). I have given up trying to get the sizing to match between Rhino7 and Rhino8 and instead am scaling the bitmap that is being displayed in the PictureBox, which works.
I noticed is that I am now getting the following warning compiling the original Rhino7 version of my plugins:
Iâm glad you found a solution that works for you; if it becomes a problem we can try to help but would need to see a sample or the source code to troubleshoot further.
This would only be shown if your plugin, or a dependency of your plugin references the âNewtonsoft.Jsonâ nuget package. Newtonsoft.Json.Rhino isnât in that nuget package so it would not be the reason for this message. You can usually resolve this by explicitly adding a package reference to Newtonsoft.Json 13.0.1 or later.