Unable to debug properly in GH For mac


(Andrew Heumann) #1

I’n using Visual Studio on mac to develop a GH plugin (for the 6 WIP). I’ve used the GH Component template:


but when I debug, I don’t hit any of my breakpoints. The plugin wasn’t showing up at all initially so I manually added a post build event to copy it to the right directory. @dan I think I asked you about this a long time ago but I can’t remember what the answer was. Any tips?


(Dan Belcher) #2

AFAICT, we don’t have this working yet for public RhinoWIPs…but we should fix it.

The Debug in RhinoWIP (Mac) guide is, unfortunately, out-of-date. I should fix that since we reworked the internal architecture of the app bundle. The reference paths should be something like this:

<ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Drawing" />
    <Reference Include="Grasshopper">
      <HintPath>..\..\Applications\RhinoWIP.app\Contents\Frameworks\RhCore.framework\Resources\ManagedPlugIns\GrasshopperPlugin.rhp\Grasshopper.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="GH_IO">
      <HintPath>..\..\Applications\RhinoWIP.app\Contents\Frameworks\RhCore.framework\Resources\ManagedPlugIns\GrasshopperPlugin.rhp\GH_IO.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="RhinoCommon">
      <HintPath>..\..\Applications\RhinoWIP.app\Contents\Frameworks\RhCore.framework\Resources\RhinoCommon.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="Rhino.UI">
      <HintPath>..\..\Applications\RhinoWIP.app\Contents\Frameworks\RhCore.framework\Resources\Rhino.UI.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="Eto">
      <HintPath>..\..\Applications\RhinoWIP.app\Contents\Frameworks\RhCore.framework\Resources\Eto.dll</HintPath>
      <Private>False</Private>
    </Reference>
  </ItemGroup>

but when I try this, the debugger still looks for a Applications/Rhinoceros.app and errors out before the build.

@curtisw I thought this would have worked. I think the above is just a bug we must have introduced.
I can log this, but I’d like a second opinion before I update the devdocs guide too.


(Andrew Heumann) #3

oh - did I make a mistake by using the NuGet packages for Grasshopper/Rhinocommon, etc?


(Dan Belcher) #4

Your proposed method of copying the file with a post-build event wouldn’t work for debugging (actually hitting breakpoints), but should work for testing and caveman debugging. But that’s not ideal.

If you have the RhinoCommon Extension installed, with the proper paths shimmed in (as the guide attempts to say), it should work. I suspect we have some more work to do with the extension (and the documentation) before this really really does work.


(Curtis Wensley) #5

Hey @dan, hm I just tried it myself and I don’t think the plugin is working with the latest v6 WIP for this scenario.

It should have at least worked by setting -app_path=/Applications/RhinoWIP.app as the start arguments, but it appears that isn’t working either (probably due to changes in VS for Mac).


(Dan Belcher) #6

Thanks @curtis I’m going to log a bug then. I’ll change the guide now with the proper paths so that I don’t forget.


(Dan Belcher) #9

This bug is logged in RH-50797.


(Dan Belcher) #10

@curtisw has updated the Visual Studio addin to 7.7.4.2 (called the RhinoCommonXamarinStudioAddin for historical purposes) here:

Aside from solving this debugging problem, it allows also you to chose which app bundle to debug with, as well as allowing command-line arguments (like: -nosplash runscript="-Grasshopper").

:beers: to Curtis.

PS: this makes the Debug in RhinoWIP (Mac) guide above obsolete.