Cannot open form in design mode in Visual Studio

This has been an on-going issuefor years, which I can normally get around by opening, closing, cleaning, compiling the project until the RenderContentUserControlCollapsibleSection form will finally open. But now I am stuck and I absolutely cannot open my form in Visual Studio. The project compiles without error.

namespace PhysicalcSoftware.OctaneRender.RhinoPlugin
{
    [System.Runtime.InteropServices.Guid("25DA894E-91E4-4866-8426-47662116AC45")]
    public partial class OctaneMaterialTreeControl : RhinoWindows.Controls.RenderContentUserControlCollapsibleSection
    { // etc

Thanks

Paul

Hi @pkinnane,

Does anything here help?

– Dale

Thanks @dale

On reading through all the posts in that thread, and other threads, this seems to be an issue in RhinoCommon, in that RenderContentUserControlCollapsibleSection does not have TypeDescriptionProvider.

https://stackoverflow.com/questions/1620847/how-can-i-get-visual-studio-2008-windows-forms-designer-to-render-a-form-that-im/2406058#2406058

I have tried the hacky workaround (#if DEBUG solution described above) but adding a middle class as follows:

namespace PhysicalcSoftware.OctaneRender.RhinoPlugin
{
    public class NonAbstractRenderContentUserControlCollapsibleSection : RenderContentUserControlCollapsibleSection
    {
        protected NonAbstractRenderContentUserControlCollapsibleSection() { }

        public override LocalizeStringPair Caption => throw new NotImplementedException();

        public override int SectionHeight => throw new NotImplementedException();
    }
}

But this does not work. If I open the original form (which is not derived from the above class), I get:

Paul

This looks like a bug in our code. We shouldn’t be attempting to run pinvokes into DLLs when the VS designer is running. I logged a bug for this at
https://mcneel.myjetbrains.com/youtrack/issue/RH-58627

Thanks Steve - I appreciate that.

Is there any chance there is a workaround for this please? I have an urgent need to edit the form (I need to add an image to an imagelist attached to the form).

Paul

Hi @pkinnane,

Sometimes this works:

1.) Build your plug-in.
2.) Go to the output folder and make a copy of your .RHP and rename the copy to .DLL
3.) Try opening your form in the designer.

– Dale

Thanks for the suggestion Dale, but unfortunately that does not work. I get the original error at the top of this thread.

Paul

From further reading, it looks like the full solution would be to fix up RenderContentUserControlCollapsibleSection so it includes a TypeDescriptionProvider as described at https://wonkitect.wordpress.com/2008/06/20/using-visual-studio-whidbey-to-design-abstract-forms/. Having RenderContentUserControlCollapsibleSection abstract is going to cause issues with Visual Studio. I am now in a situation where I cannot make an important change to my form, and completely stuck :frowning:

Paul

Sorry to hassle McNeel on this, but I still cannot open my form, and need to release a new version of the plugin. Is there a solution to this issue please?

Thanks

Paul

Hi Paul,

I actually started to look at this an hour ago. I think the correct solution is the TypeDescriptionProvider solution. I try to add that fix now.

Best Regards
Max

I had to also add the Design mode check that Steve mentioned.

This YT https://mcneel.myjetbrains.com/youtrack/issue/RH-58627
is now fixed.

Br,Max

Awesome - thanks Max. Are you able to tell me which version of Rhino 7 will have this fix please?

Paul

Hi Paul -

The fix (per now untested) is in the current internal builds and will thus be in the next public build - which, if all goes well, will be released next Tuesday / Wednesday.
-wim

Paul, if you need a build before Tuesday, just let us know and we’ll send you a link

Thanks Steve. I can wait.

Paul