1

Simple question, but likely a big answer. I have a C# solution that comprises of multiple projects - I want to add the ability to drop in a DLL plugin that will "hook in" to the program and add additional functions.

I want to be able to have entry points, for example on a checkout screen where it calculates the price, the DLL will say "I need access to this routine/entry point" and then be able to access the pricing variables that are in the application at that moment and output to show a customized discount or something like that.

Can anyone recommend a way of accomplishing this? Are there frameworks/libraries that exist to make this possible?

Thanks so much.

Qjimbo
  • 377
  • 2
  • 11
  • I've honestly never come across someone wanting this, wouldn't it be better to add the "calculations" code into your project, and have some user-input on the fly to calculate the discount? Perhaps a database if the discount is meant to change often, and a voucher code? – Corey Thompson Feb 04 '16 at 01:34
  • I know via registry editor microsoft RMS lets you register dlls in the GAC and hook into them via regedit. Is that what you're looking for, kind of? – Joshua Smith Feb 04 '16 at 01:55
  • i think the problem is that its kinda redundant. If you drop the dlls in, you have no guarantee the values you need are publicly exposed, so even if you went all com and instancated the app by its process, Process.GrandtTotal may not be a public property To ensure it is, youd have to write the calling apps (hopefully using modern listener methods and not com)... at that point you can just as easily drop your dll in at compile time and call it like any other library – Muckeypuck Feb 04 '16 at 02:35
  • CoreyThompson - the issue is that down the road there will be more and more different plugins, each one adding it's own calculation logic at a certain point. I don't want to build the program up with lots of if statements and clutter in the "clean" logic. JoshuaSmith - May have to look into that, I didn't really want something on the system level in that way, but sounds intruiging. Muckeypuck - The thing is I don't want it to be at compile time, I want to have a running system I can insert plugins into. Thanks for all your comments! – Qjimbo Feb 04 '16 at 17:09

0 Answers0