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.
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.
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:
…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.
- In Visual Studio for Mac, right/option-click on the project name and select Tools > Edit File…
- Use Visual Studio for Mac’s Search > Replace function to find \Applications\Rhinoceros.app and replace it with \Applications\RhinoWIP.app…
Verify that these changes are only happening with the
<Reference>entries. Accept your \Applications\RhinoWIP.app replacements to make the change. If you are not using Nuget packages, you will also need to add some changes to the default hint paths so they search the proper location within the app bundle:
<ItemGroup> <Reference Include="System" /> <Reference Include="System.Core" /> <Reference Include="System.Drawing" /> <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>
- Save and Close your project’s .csproj.
- 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.
- Build and Run. Your plugin’s debugging session should now launch with RhinoWIP.