CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Assemblies!?!?

  1. #1
    Join Date
    Feb 2006
    Posts
    8

    Assemblies!?!?

    Hello Gurus,

    I'm writing a small game platform which offers API (Interfaces) to be implemented by others. Once one implements the interfaces he can load his game to the platform.

    What i would like to do is to dynamically load (at runtime) those implemented interfaces. I would like the implementor to put his imeplementation in a subdirectory of my platform and the platform to load that game at runtime.

    Should i use private assemblies for that? What is the right technology i should use?

    I'm not looking for a way to monitor the directory; What i'm looking for is just the way to load a class that implements one of my interfaces and activate its methods, all done in runtime.

    As you can see from my question, i'm new to C# so please if you can point me to the right direction....

    Thanks.

  2. #2
    Join Date
    Nov 2004
    Location
    Poland
    Posts
    1,355

    Re: Assemblies!?!?

    Should i use private assemblies for that?
    Yes.

    And Yes- U are in right direction

    Best regards,
    Krzemo.

    PS: What u want to implement is the plugin interface. If U google for it U will find many ready to use solutions.

  3. #3
    Join Date
    Feb 2005
    Location
    Israel
    Posts
    1,475

    Re: Assemblies!?!?

    You can use the Assembly.LoadFile method to load an assembly at run-time using a path.
    You can use reflection (Assembly.GetTypes for example) to get all the types in that assembly and find out which implement the interface you need.

  4. #4
    Join Date
    Feb 2006
    Posts
    8

    Re: Assemblies!?!?

    Thanks, guys.

    I use the private assemblies and it works fine.

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured