Passing in multiple class libraries of different types to a method

I haven't had to do this for years and forget how.

I have a method that I want to sometimes run with one library and sometimes another. Other than the library I'm using, the method is exactly the same. The same deletion handling, file handling everything.

How do I pass in a library to a method and let the method accept either library?

asp.net vb.net but C# is fine if that's all you've got.

Thanks!
LVL 2
Starr DuskkASP.NET VB.NET DeveloperAsked:
Who is Participating?
 
Miguel OzSoftware EngineerCommented:
What kind of method is it?
For static methods you could use:
https://dotnetcodr.com/2014/10/15/dynamically-invoking-a-static-method-with-reflection-in-net-c/

it basically uses reflection to load your assembly at run time and calls the method.

IF more help needed please provide sample code on how you method is defined on both assemblies as it it could be as simple as creating two objects associated with the respected assembly and just call them directly based on whatever logic decides which one to use
0
 
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
wasn't what I was looking for, but i've moved on. thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.