Site News For 11/5/2007How To Create a CAPTCHA Graphic in VB.NET

Application Plug-ins Code Example Update

November 5th, 2007

Update On Creating Application Plugins in VB.NET

As a follow-up to my previous article, How To Create Application Plug-ins In VB.NET, Karl Stoney asked for a more complete example. Hopefully this update will help.

Tips and Tricks

One trick you can use to make your development of these plugins easier is to have multiple projects in your solution. In the case of the demo app I added the main demo project, the interface project, and the two plugin projects to the solution. If I wanted to have another plugin, I would just add it to this solution. This makes debugging easier and saves system memory somewhat vs. running separate instances of Visual Studio

Another trick is to change the compile output folder to a common folder. This puts all of the executable in the same folder, once again for easy debugging. Remember that your plugins when deployed must be in the same folder as the calling application.

The Demo

In this code example, we have a PluginDemo application that can call various plugins that conform to the IMyPlugIn interface. We also have a PlugIn1 and a PlugIn2 projects that implement the interface in different ways. PlugIn1 uses a standard message box while PlugIn2 uses a custom form.

The core code itself isn’t any different from the code presented in the previous article. The LoadPlugIn routine is the key to using Reflection to load the plugin. To get a better understanding of how it all comes together I recommend stepping through the process as it runs.

The zip file contains the project code but I excluded the executables. After unzipping the project you will need to first build the PlugInInterface project by itself. This will create the DLL that the other 3 projects need to reference. Once you’ve done this, do a Build Solution and it should be ready to run.

Here’s the demo zip file: VB.NET Application Plugin Demo

Let me know if you have any questions about this demo or application plug-ins in VB.NET.

Share This Article: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Reddit
  • StumbleUpon
  • Technorati
  • DotNetKicks
  • DZone

Entry Filed under: Code Examples

Rate This Article:

Not That GoodCould Be BetterOKGoodGreat (5 votes, average: 3.6 out of 5)
Loading ... Loading ...

6 Comments Add your own

  • 1. Rahn  |  January 22nd, 2008 at 9:22 am

    Nice little demo. I have a couple projects I’d like to add plugin’s to, so this helps out.

    Couple issues I ran into running it:
    - When loading the solution, need to reset the references to the different projects.
    - When running, need to move copies of the plugin DLL’s into the PluginDemo\Output folder, which is where the program is looking for them (instead of the \bin directories of the individual projects).

    Nothing big, since anyone developing plug-ins should be skilled enough to figure this out, but thought it was worth mentioning. :)

  • 2. 655  |  March 11th, 2008 at 11:46 am


  • 3. Kureigu  |  November 3rd, 2008 at 10:29 pm



    Suppose I have finished creating a usercontrol that inherits a the textbox, and then add a property name tablename. When we will use this control we can see a new property named tablename in the property window, right? My question is how to make this property I add in the control as searchable, or like when we select the tablename property in the property window it will give a ellipse button or maybe a dropdown that enables us to select the list of tables we have created in the database?

  • 4. Sebastian  |  September 25th, 2009 at 10:59 am

    Thanks for the code, very useful!!

  • 5. Rulo  |  October 9th, 2009 at 5:08 pm

    Thank you! Just what I was looking for! (Gracias! Justo lo que estaba buscando!)

  • 6. Rob  |  January 30th, 2010 at 7:50 am

    This is my first Advanced Type Application that I’m attempting so far all my applications have all been self contained meaning that they didn’t need any ‘outside’ files to function.

    So I’ve read through your first tutorial on Plugin Architecure and this one as well, however one thing I am running into is on the HOST application when I write the line.

    Dim NewPlugIn As PlugInInterface.IMyPlugIn = LoadPlugIn(String.Concat(My.Application.Info.DirectoryPath, “\”, cboPlugIns.Text, “.dll”))

    PluginInterface is not exposed to the Main App, how to you get the main app to recognize this? The error I get is “Type PluginInterface is not Defined”

    I grasp everything else pretty much however this is throwing me for a loop. Thank you

Leave a Comment


Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed

Visit Me At My New Site, Programming In C#

Most Popular Articles

Highest Rated Articles


Most Recent Articles


 Subscribe in a reader

To subscribe by e-mail
Enter your address here

Delivered by FeedBurner

VB Opportunities