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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:50:08+00:00 2026-05-27T07:50:08+00:00

How to call some method via Reflection without any parameters and any return values?

  • 0

How to call some method via Reflection without any parameters and any return values?

Here is MSDN sample

// Define a class with a generic method.
public class Example
{
    public static void Generic<T>()
    {
        Console.WriteLine("\r\nHere it is: {0}", "DONE");
    }
}

What should be within typeof(???) then?

MethodInfo miConstructed = mi.MakeGenericMethod(typeof(???));

Thank you!!!

  • 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-27T07:50:09+00:00Added an answer on May 27, 2026 at 7:50 am

    If you were invoking that through C#, you would need to supply a type, for example:

    Example.Generic<int>();
    

    that requirement does not change; simply, that line would become:

    mi.MakeGenericMethod(typeof(int)).Invoke(null, null);
    

    For a complete, working illustration:

    class Example
    {
        public static void Generic<T>()
        {
            System.Console.WriteLine("\r\nHere it is: {0}", "DONE");
        }
        static void Main()
        {
            var mi = typeof (Example).GetMethod("Generic");
            mi.MakeGenericMethod(typeof(int)).Invoke(null, null);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a method which I would like to call via reflection. The method
Is it possible to call a protected method via reflection. I am using this:
Is it possible to call a method by reflection from a class? class MyObject
Let's say I have a subroutine/method that a user can call to test some
Hi can some body help me how to call process.existed() method in c#? Actually
The Problem I'm running multiple invocations of some external method via an ExecutorService .
I have some method doA() that occasionally hangs for a while. Are there any
I'm attempting to pass an std::function via a method like so: class dispatch {
I need to call some methods in Wininet.dll from a Java program. I can
We have some methods that call File.Copy, File.Delete, File.Exists, etc. How can we test

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.