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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:29:48+00:00 2026-06-14T21:29:48+00:00

I am currently using Linfu to create dynamic proxys, and it works really well

  • 0

I am currently using Linfu to create dynamic proxys, and it works really well for normal interfaces. The problem is I now need to create a dynamic proxy for an interface with generic parameters. I do not know the types of the generic parameters (or even load the assemblies containing them) until runtime. Does anyone know if this is even possible?

  • 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-06-14T21:29:49+00:00Added an answer on June 14, 2026 at 9:29 pm

    Ok, I can do it by calling MyProxyFactory.CreateProxy< T >() with reflection something like this:

            Type myGenericParam1 = myParam1.GetType();
            Type myGenericParam2 = myParam2.GetType();
            Type myGenericInterfaceType = typeof(IMyInterface<,>);
            Type myActualInterfaceType = myGenericInterfaceType.MakeGenericType(myGenericParam1, myGenericParam2);
            var proxyObjectContainer = typeof(MyProxyFactory).GetMethod("CreateProxy", new Type[] { }).MakeGenericMethod(new[] { myActualInterfaceType }).Invoke(null, new object[] { });
    
            var proxyObject = proxyObjectContainer.GetType().GetProperty("Proxy").GetValue(proxyObjectContainer, null);
    

    Obviously if you need to pass parameters to the proxy factory constructor for setting up your interceptor then this also needs to be added into the line that creates the proxyObjectContainer.

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

Sidebar

Related Questions

Im currently using Apache behind an Nginx Proxy which really works fine with one
Currently using Chrome v19.0.1084.46 (Official Build 135956) beta-m jqGrid 4.3.2 (latest release) The problem
Im currently using the JQuery UI extension for its search autocomplete. However, I need
I`m currently using: <%= f.time_select :day,:default => Time.now, :ampm => true, :minute_step => 15
Currently using a really simple Twisted NameVirtualHost coupled with some JSON config files to
I am currently using matplotlib.pyplot to create graphs and would like to have the
Im currently using JSP and need to get the a cell in a table.
I'm currently using the appearance proxy object for customising my application interface. I would
I would like to create a dynamic proxy for binding WinForms controls to objects
Currently using HtmlUnit. Getting first login page is no problem, succesfully logging in, getting

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.