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 3720692
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:18:05+00:00 2026-05-19T05:18:05+00:00

I am working on an add-on component that needs to play nice with other

  • 0

I am working on an add-on component that needs to play nice with other similar add-ons. There is a 3rd party component that decided to implement the functionality a little differently than the default.

What I am trying to do is call an overload of a method that only the 3rd party component has, like this:

Select Case True
    Case TypeOf provider Is 3rdParty.Provider
        result = DirectCast(provider, 3rdParty.Provider).GetNames(method, True)
    Case Else
        result = provider.GetNames(method)
End Select

Unfortunately, the DLL that contains 3rdParty.Provider is optional, so this code will give compile errors if it is not present. How can I accomplish the same thing but make it safe to run whether the 3rdParty.Provider.dll is present or not?

  • 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-19T05:18:06+00:00Added an answer on May 19, 2026 at 5:18 am

    After some trial and error and going through several MSDN docs and forum posts, I was able to piece together the following solution:

    Dim t As Type = Type.GetType("3rdParty.Provider, 3rdParty.Provider")
    Select Case True
        Case Object.ReferenceEquals(provider.GetType(), t)
            result = Convert.ChangeType(provider, t).GetNames(method, True)
        Case Else
            result = provider.GetNames(method)
    End Select
    

    I tested removing the 3rd party DLL reference from my project and this works without a hitch and calls the default GetNames in that case without any exceptions or compile errors.

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

Sidebar

Related Questions

I am working on a .NET-based server component that talks to a set of
I'm currently working on an application that needs to change certain settings on the
I have a Registration-Free COM component I developed that is working fine on target
I am currently working on an online quiz component and need to add a
I'm working on a project that needs to be able to have JComponents inserted
On one of projects that I'm working on, we decided to change our presentation
As I'm working to add custom printing to my application, I've settled on using
I am working to add 1 month to date() and save it in my
I'm working on an ASP.Net application and working to add some Ajax to it
I have a form in witch users can add their working hours view them

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.