Reputation: 1510
I have a little problem understanding what I should do.
I have a main project MainProj
.
And another project called PluginHandler
who has an IPlugin
interface.
What I'm trying to achieve is to "send" an object called Network
from MainProj
to each plugin that implement the IPlugin
interface.
My problem is what type should I write in the IPlugin
, because it's in a different project I can't just say Network
- and I can't reference it because I need a reference to the PluginHandler
in the MainProj
, in order to instantiate each plugin (using reflections)
Any ideas?
Upvotes: 1
Views: 949
Reputation: 23093
You need to create a "shared library". So instead of
you should have
So you place the Network
class inside the Common
project and reference this by all other projects.
Upvotes: 2
Reputation: 1977
You just need to add the other project as a reference in your MainProj
and then add a using statement to import that namespace into your file.
When adding a reference you can either choose a dll or just choose another project.
Upvotes: 0