reflection-method-find

Locates methods in C# assemblies using configurable name and parameter matching.

Updated Feb 4, 2024
One-click install
npx skills add https://github.com/sprillion/gem_td --skill reflection-method-find-sprillion
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: reflection-method-find
Source: https://github.com/sprillion/gem_td/tree/main/SKILLS/reflection-method-find
Command: npx skills add https://github.com/sprillion/gem_td --skill reflection-method-find-sprillion

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Locating a specific method in a large C# codebase can be tedious when assemblies are numerous and visibility is restricted. This Skill uses .NET reflection to search across all assemblies, identifying a method by its name, class, and parameter signature, including private methods if needed, so you can obtain exact method references for invocation.

Core Features & Use Cases

  • Cross-assembly search: find methods by name, class, and parameter signature across all loaded assemblies.
  • Private method discovery: locate non-public methods available via reflection.
  • Retrieval for invocation: return a reference suitable for a subsequent reflection call.
  • Configurable matching: supports partial or full name matching and parameter sensitivity to fit real-world codebases.

Quick Start

Provide a method reference (class name, method name, and parameters) to locate the matching method across the project and prepare it for invocation.

Frequently Asked Questions about reflection-method-find

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find a private method in a C# assembly using reflection?

To find a private method via C# reflection, search across loaded assemblies by specifying the class name, method name, and parameter signature. This enumerates all assemblies and returns the exact method reference, even for non-public methods, making it available for subsequent invocation.

Can I search for methods across multiple .NET assemblies at once?

Yes, you can perform a cross-assembly search across all loaded .NET assemblies. By matching the target type and method name with configurable sensitivity, you can locate the exact method reference across the entire project without manually checking each assembly.

How do I locate a C# method when I only know its parameter signature?

You can locate a C# method by providing its class name, method name, and parameter signature. The search applies configurable parameter sensitivity to match exact or partial signatures across assemblies, returning a reference suitable for direct reflection invocation.

Does reflection search support partial name matching for C# methods?

Yes, the reflection search supports configurable matching for C# methods. You can apply either partial or full name matching alongside parameter sensitivity, allowing you to effectively locate target methods within real-world codebases where exact names might vary.

What is the best way to get a method reference for dynamic invocation in C#?

The best way to obtain a method reference for dynamic invocation in C# is to use reflection to locate it across assemblies. By searching with the class name, method name, and parameters, you retrieve a precise reference ready for a subsequent reflection call.

Are there limitations when using reflection to find non-public methods in .NET?

When using reflection to find non-public methods in .NET, you must provide exact class and method names with parameter signatures for accurate matching. While it successfully discovers private methods, subsequent invocation may still require appropriate access permissions or binding flags.