Dot Net Express Editions
Last changed: -77.73.8.70

.
SummaryHow to build and debug Rhino.NET plug-ins for Rhino4 with the free express editions of Microsoft VB.NET 2005 and C# 2005

Microsoft now provides free trimmed down versions of there developer products called "Express Editions." The two products in particular that I will be discussing here are the express editions of:

These products can be used 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 really a matter of syntax preference. Both programming languages should be able to build to same quality of plug-in; it just depends on the langauge that you feel "more" comfortable with. If you are not sure, download them both.

The installer let's you choose which components to download and install. The default settings work fine for developing Rhino plug-ins. The extra items that are unchecked that you may be unsure about are:

Install the Rhino.NET plug-in project and command wizards

This can be found at DotNetProjectAndCommandWizards

Create a Rhino plug-in project

  1. Start either VB.NET or C# and go to File...New Project. You should see an option for Rhino Plug-In. Select this, provide a name for your project, and click OK. I choose the default project name of MyPlugIn1
  2. A dialog should appear with options that the wizard uses when creating your plug-in project. Please note that you can always change these options at a later time in the code; these options just allow the wizard to fill out typical plug-in information. I choose to not change any of the default values and clicked the Finish button.
  3. Once your project is created, save it. I clicked on File...Save All to save the project to the location of my choice.

Compile the plug-in

I like to have the output window showing when compiling my projects. This way I can see what is going on. To show this window, click on Debug... Windows ... Output

You have to compile your project into a DLL (assembly) before you can try it in Rhino. This can be done by clicking on 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. In order to debug your plug-in, you need to tell the compiler that you want rhino4.exe to start and then have the debugger latch on to that process.

In order 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 on 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