Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 733383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:15:05+00:00 2026-05-14T07:15:05+00:00

I’m trying to add plugins to my game and what I’m trying to implement

  • 0

I’m trying to add plugins to my game and what I’m trying to implement is this:

  • Plugins will be either mine or 3rd party’s so I would like a solution where crashing of the plugin would not mean crashing of the main application.

  • Methods of plugins are called very often (for example because of drawing of game objects).

What I’ve found so far:

  • 1) http://www.codeproject.com/KB/cs/pluginsincsharp.aspx – simple concept that seems like it should work nicely. Since plugins are used in my game for every round I would suffice to add the Restart() method and if a plugin is no longer needed Unload() method + GC should take care of that.

  • 2) http://mef.codeplex.com/Wikipage – Managed Extensibility Framework – my program should work on .NET 3.5 and I don’t want to add any other framework separately I want to write my plugin system myself. Therefore this solution is out of question.

  • 3) Microsoft provides: http://msdn.microsoft.com/en-us/library/system.addin.aspx but according to a few articles I’ve read it is very complex.

  • 4) Different AppDomains for plugins. According to Marc Gravell ( Usage of AppDomain in C# ) different AppDomains allow isolation. Unloading of plugins would be easy. What would the performance load be? I need to call methods of plugins very often (to draw objects for example).

    • Using Application Domains – http://msdn.microsoft.com/en-us/library/yb506139.aspx

    • A few tutorials on java2s.com

Could you please comment on my findings? New approaches are also welcomed! Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T07:15:05+00:00Added an answer on May 14, 2026 at 7:15 am

    You can define a public interface which the plugin’s must implement. Then with the use of reflection you can scan a “plugin” folder for any classes implementing that interface, then create an instance of that class.

    From you’re code just work on the interface and call the needed method’s. About crashing, always make sure that calls to the “plugin” interface are always encapsulated in a try/catch block. If an exception occurs you can always dispose the plugin

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.