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

  • Home
  • SEARCH
  • 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 8748869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:35:56+00:00 2026-06-13T12:35:56+00:00

This is part of DynamicObject class: public class DynamicObject : IDynamicMetaObjectProvider { … public

  • 0

This is part of DynamicObject class:

public class DynamicObject : IDynamicMetaObjectProvider
{ 
    ...
    public virtual bool TryInvoke(InvokeBinder binder, object[] args, out object result)
    {
      result = (object) null;
      return false;
    }
    ...
    public virtual bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result)
    {
      result = (object) null;
      return false;
    }
}

From MSDN:
TryInvoke: Provides the implementation for operations that invoke an object
TryInvokeMember: Provides the implementation for operations that invoke a member

I want to know the real difference between this two methods because they have almost the same syntax and implementation. I already know that TryInvoke if for objects or delegates, and TryInvokeMember is for methods, but why two methods for this? A good example would be appreciated.

  • 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-13T12:35:56+00:00Added an answer on June 13, 2026 at 12:35 pm

    The documentation isn’t really clear, but the examples for TryInvoke and TryInvokeMember show the difference. TryInvoke is called when invoking the object (that is treating it like a delegate) and TryInvokeMember is used when invoking a method on the object.

    The example below is derived from the MSDN samples:

    dynamic number;
    ....
    // Invoking an object. 
    // The TryInvoke method is called.
    number(2, "Two");
    
    // Calling a method
    // The TryInvokeMember method is called.
    number.Clear();
    

    The implementations you are showing are the same because they are both null implementations. Returning false means that the method that is trying to be called is not implemented.

    If there was a non-null implementation the difference would be that TryInvokeMember would examine the binder.Name property to determine which method would be called, while that would not be set for TryInvoke.

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

Sidebar

Related Questions

Considering this part of a Java class, private List<Object> components = new ArrayList<Object>(); private
In this part of code: System.out.println(Alunos aprovados:); String[] aprovados = {d, a, c, b};
I'm having this (part of) code in my header class Node { Node prevNode;
Help me with this part of code: class Ooo attr_accessor :class_array end def func(ctx)
I did part of this code for a class exercise and the code is
I've this part of code: public void onClickHandler(View a) { String pressed = null;
Here's my idea: Start with a simple object: class dynamicObject(object): pass And to be
This part of my code works fine: #include <stdio.h> int main(){ //char somestring[3] =
This part of my code is used to award a grade to a student
This part of an app that I am working on, I have the following

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.