Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Developing Plug-Ins in .NET

Status
Not open for further replies.

ns1234

Programmer
Dec 3, 2002
6
Hi All

I was recently asked to develop a plug-in in .NET? What are plug-ins? Are they the same as COM components? How do create a plug-in in .NET? Would appreciate if some one can elaborate on this with an example.

Thanx
 
I think the term plug-in refers to a piece of software developed to a specification so that a larger application can use it. Not a specific .NET thing. For instance, the Flash viewers for IE and Netscape are plug-ins. The browser itself is not modified to play .swf files, but it can now since you installed the Flash plug-in.

Can you build a plug-in in .NET? I would think so, as long as the host application is written in .NET, and exposes an interface for plug-ins.

Maybe they are referring to a Control or Library??

Greetings,
Dragonwell
 
ns1234 -
To write a plug in, you'll need to learn how to call code via an interface. This is usually called "programming via contract", as the interface represents a contract that all plugins would have to implement in order for the main app to be able to call them.

You'll need a minimum of 3 assemblies:
1) The main application.
2) The interface.
3) One or more plugins that implement the interface.

When the main app needs to load a plugin, it checks in a special directory for assemblies. It determines which of them it needs to load, then calls Assembly.LoadFile, after which it then calls GetType(), and assigns the result to a variable of your interface type. Once it has that, it will be able to call the code that is resident in the plugin.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
thanx for your inputs. Can anybody provide me a sample program as to how to develop a simple plugin in .NET so that I can get a better idea.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top