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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:10:16+00:00 2026-05-24T01:10:16+00:00

When proxying an object and intercepting a method using castle dynamic proxy, is it

  • 0

When proxying an object and intercepting a method using castle dynamic proxy, is it possible to get the return value of the target method? I have tried using the following methods,

object result = invocation.GetConcreteMethod().Invoke(instance, null); 

object result = invocation.GetConcreteMethodInvocationTarget().Invoke(instance, null); 

This causes an infinite loop. I want to be able to get the return value of the original target method being proxied before calling Invocation.Proceed().

EDIT — Fyi I got it to work by using Activator.CreateInstance, but I’m wondering if there is a cleaner way to achieve the equivalent:

object instance = Activator.CreateInstance(invocation.TargetType); 

invocation.MethodInvocationTarget.Invoke(instance, invocation.Arguments); 

The problem is that this is simply a new un-proxied instance of the original object, whereas I want the original un-proxied instance itself.

  • 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-24T01:10:17+00:00Added an answer on May 24, 2026 at 1:10 am
    invocation.Proceed();
    
    var returnValue = invocation.ReturnValue;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have setup nginx as a front end to an node.js app. My nginx
I am currently in the process of porting a recent symfony 1.4 application to
I want to create a custom widget that contains a QSpinBox. I want the
I am trying to route a rest request from a cxf rest service to
I know there's already a lot of questions on this topic but I might
I'm trying to access a repository on Github from a Windows machine that is
From https://developer.mozilla.org/En/Gecko_Plugin_API_Reference:Scripting_plugins : This API is not designed to be thread safe. The threading
I maintain a website with apache at port 80 and jboss at 8080. Additionally,

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.