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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
wasn't what I was looking for, but i've moved on. thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.