Summary: How to build and debug Rhino.NET plug-ins for Rhino 4 with the free express editions of Microsoft VB.NET 2008 and C# 2008.
Notice: The Rhino.NET SDK is deprecated in Rhino 5. This article adapted for the new RhinoCommon SDK and latest version of Visual Studio is here.
Microsoft now provides free trimmed down versions of their developer products called Express Editions. The two products in particular that I discuss here are the express editions of:
Use these products to develop .NET plug-ins for Rhino 4. Here are some helpful steps to get you started:
Download and install VB.NET or C#
Choosing between VB.NET and C# is a matter of syntax preference. Both programming languages should be able to build to the same quality plug-in. It just depends on the language that you feel more comfortable with. If you are not sure, download both.
The installer lets you choose which components to download and install. The default settings work fine for developing Rhino plug-ins. The extra unchecked items that you may be unsure about are:
Install the Rhino.NET plug-in project and command wizards
Create a Rhino plug-in project
Compile the plug-in
I like to have the output window show when compiling my projects. This way I can see what is going on. To show this window, click Debug… Windows … Output.
You have to compile your project into a DLL (assembly) before you can try it in Rhino. Do this by clicking Build… Build my project name. The output window will tell you if everything went ok.
Debugging the plug-in
Here's the tricky part (and it's not really that tricky.) The express editions don't expose controls to set up your plug-in project for debugging. To debug your plug-in, tell the compiler that you want rhino4.exe to start and then have the debugger latch on to that process.
To set up the debugger for your project, perform the following steps:
Run your plug-in
Once you've done the above, reopen your project in VB.NET or C# and click Debug… Start Debugging. If you were successful, Rhino will start.
Load your plug-in with the PlugInManager. Once your plug-in loads, try running the custom command that the wizard defined in your plug-in. If you click on the properties button in the plug-in manager you will see that your plug-in has a command named something like MyPlugIn1Command.