Debug in RhinoWIP (Mac)

This guide explains how to debug using the RhinoWIP for Mac.

By the end of this guide, you should understand how to modify your plugin’s C# project file in order to target and debug using RhinoWIP.

Prerequisites

This guide presumes you have installed all the necessary tools and know how to build and debug a plugin using RhinoCommon with Rhinoceros.

It also presumes you have downloaded and installed the latest RhinoWIP.


Edit References

Your plugin requires references to RhinoCommon dlls that are contained within the Rhino application bundle. The default RhinoCommon Plugin template that comes with the Rhino Xamarin Studio AddIn references Eto, Rhino.UI, and RhinoCommon:

Bundle References

…which are all contained within the Rhinoceros.app bundle.

We want to target those found in the RhinoWIP.app bundle. Unfortunately, Visual Studio for Mac does not allow you to browse to references that are contained within an application bundle. We will have to “manually” change these references so that they target the appropriate versions contained in RhinoWIP.

Step-by-Step

  1. In Visual Studio for Mac, right/option-click on the project name and select Tools > Edit File
    Visual Studio for Mac Edit File
  2. Use Visual Studio for Mac’s Search > Replace function to find \Applications\Rhinoceros.app and replace it with \Applications\RhinoWIP.appSearch and Replace
  3. Verify that these changes are only happening with the <ItemGroup> that contains <Reference> entries. Accept your \Applications\RhinoWIP.app replacements to make the change…

     <ItemGroup>
       <Reference Include="System" />
       <Reference Include="System.Core" />
       <Reference Include="System.Drawing" />
       <Reference Include="RhinoCommon">
         <HintPath>..\..\Applications\RhinoWIP.app\Contents\Resources\RhinoCommon.dll</HintPath>
         <Private>False</Private>
       </Reference>
       <Reference Include="Rhino.UI">
         <HintPath>..\..\Applications\RhinoWIP.app\Contents\Resources\Rhino.UI.dll</HintPath>
         <Private>False</Private>
       </Reference>
       <Reference Include="Eto">
         <HintPath>..\..\Applications\RhinoWIP.app\Contents\Resources\Eto.dll</HintPath>
         <Private>False</Private>
       </Reference>
     </ItemGroup>
    
  4. Save and Close your project’s .csproj.
  5. The project will reload automatically. In the Solution Explorer, select any of the three references you just changed above. If you examine their properties (right/option-click > Properties), you will notice they are now referencing the RhinoWIP.app versions.
  6. Build and Run. Your plugin’s debugging session should now launch with RhinoWIP.