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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:23:38+00:00 2026-05-28T16:23:38+00:00

I am utilising a 3rd party .net dll, which I am making calls to.

  • 0

I am utilising a 3rd party .net dll, which I am making calls to. I am simplifying my code, but it’s something like this.

// The assembly has already been loaded into 'ass'

Type params = ass.GetType("RemoteCalls.ParametersDelegate");
Delegate UseDel = Delegate.CreateDelegate(params, this, "MyGetParams");

I can then pass this delegate (UseDel) into the reflected object, and it will call MyGetParams when it needs to.

The problem I’m having is that the method signature is made up of a type within the 3rd party dll.

The signature of the ParametersDelegate is…

Parameters GetPars();

So, my method can’t return the correct type (Parameters). I have tried the following..

private static class OtherDelegates<T>
{
    public static T MyGetParams()
    {
        //... code to build up the 'Parameters' class, and return it.
    }
}

Then calling..

Delegate UseDel = Delegate.CreateDelegate(params, this, "OtherDelegates<xxx>.MyGetParams");

But I can’t work out what to put in ‘xxx’.

I think that I might be able to do this by using CodeDomProvider , but wondered if there is a simpler way ?

Also, it’s not an option to add the DLL as a reference due to licensing issues.

Thanks
Rich.

  • 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-28T16:23:39+00:00Added an answer on May 28, 2026 at 4:23 pm

    I would completely encapsulate the third party dll behind a library dll that you control, using none of the 3rd-party types on the interface. This means you can reference your (already built) library dll in isolation. Obviously you still need to code in sch a way that it fails gracefully when the 3rd party dll is not available.

    This also has side benefits:

    • you can mock the implemetation for testing
    • you can provide a fallback strategy the 3rd party dll isn’t there
    • you can potentially support multiple providers

    I’ve used the above very successfully, for example wrapping MapPoint (geo-routing) with a great-arc fallback.

    Plus – you don’t need to mess around with the reflection!

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

Sidebar

Related Questions

I've deployed a desktop application utilizing 3rd party dll's to a test terminal server
I'm utilising the AddressBook.framework in my iPhone app, and I'd like to replicate something
For those of you making iphone applications that record video Are you utilising the
this is a b-day reminder code utilizing linkedlists typedef struct node { char name[61];
I have a 3rd-party protocol module (SNMP) that is built on top of asyncore.
I have a small vb.net application utilising the FileSystemWatcher hooked up to a UNC
I'm attempting to utilize a 3rd-party PHP library in a semi-developed web project. Unfortunately,
Utilising this tutorial I'm trying to see if I can save bandwidth with a
Not that I would want to use this practically (for many reasons) but out
I am looking at utilising the GPU for crunching some equations but cannot figure

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.