Re: How to use interfaces properly...

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You do not need to have your own copy of the assembly. But wherever it is,
it should be reachable by te code that needs it. You might want to load it
at runtime or install it into the GAC.

"Bagger" <Bagger@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9CE9B509-325B-492D-ADB4-35E1ABED243D@xxxxxxxxxxxxxxxx
> Ok, I have been testing some things and now I have questions about it. I
> created a dll assembly that contains just one interface (called
> ITestInterface), which in turn just has one string property called
> TestName.
> I built that project and then closed it. Then, I created a windows forms
> project and added a reference to that assembly (it's named
> MyInterfaceTest).
> Now, before I did anything else, I ran the project and a blank form came
> up.
> That was as expected. Then I added the "Implements
> MyInterfaceTest.ITestInterface" line and it added the property code for
> me.
> I built the project again and it ran fine. Then I changed the "Copy
> Local"
> property on the reference to "false". I ran the project again and it gave
> me
> an error:
>
> -----------------------
> An unhandled exception of type 'System.IO.FileNotFoundException' occurred
> in
> Unknown Module.
>
> Additional information: File or assembly name MyInterfaceTest, or one of
> its
> dependencies, was not found.
> -----------------------
>
>
> Ok, so now I'm kind of confused. Does each application that implements an
> interface have to have its own copy of the dll that contains the
> interface?
> I'm asking this mainly because I'm working on building an app that uses a
> plugin architecture, and I am having trouble figuring out how to set up
> references that will work during development, but will also let the plugin
> developer drop his executable and associated files into the main
> application's plugins folder without breaking it. Can anyone explain how
> this should be done? Thanks!


.



Relevant Pages

  • Re: C# Plugin system - same interface in two different assemblies...
    ... "add a reference to the appropriate assemblies to each and every project"? ... You don't have each plugin project deciding what ... its idea of the interface is. ... can't by forcing people to include them in assemblies as I've explained. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Thanks... but...
    ... What you need to do is create an interface that the main form will ... You should have a constrained set of functionality that the form implements ... I already created an abstract PlugIn class which is the base class for ... I have a reference to my main form in the PlugIn class. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to use interfaces properly...
    ... so what exactly was breaking in the example I gave? ... >> MyInterfaceTest). ... >> interface have to have its own copy of the dll that contains the ... >> references that will work during development, but will also let the plugin ...
    (microsoft.public.dotnet.framework)
  • How to use interfaces properly...
    ... project and added a reference to that assembly (it's named MyInterfaceTest). ... interface have to have its own copy of the dll that contains the interface? ... references that will work during development, but will also let the plugin ...
    (microsoft.public.dotnet.framework)
  • Re: Thanks... but...
    ... Because I want my plugin to interact directly with the GUI of my ... I have a reference to my main form in the PlugIn class. ... You can define an interface that the main form implements, ...
    (microsoft.public.dotnet.languages.csharp)