Skip to content

sojohnnysaid/ReflectionExplorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

.NET Reflection Explorer

An interactive CLI tool for deep exploration of .NET assemblies and NuGet packages using reflection. Perfect for when you need to go deeper than surface-level API documentation and really understand the internals of any .NET library.

🎯 Purpose

While tools like PackageAnalyzer give you a great overview of package contents, Reflection Explorer is designed for deep, interactive exploration. It's your workspace for understanding how libraries work by letting you:

  • Search interactively - Type partial names like "sign" or "auth" to find all matching types
  • Explore at runtime - See actual loaded assemblies and their types
  • Accumulate knowledge - Add multiple packages to compare and learn from
  • Navigate relationships - See what interfaces a class implements, base types, and more

✨ Key Features

Interactive CLI Menu

  • Real-time exploration without writing code
  • Navigate namespaces, types, and members interactively
  • Search functionality to find types by partial name
  • Detailed analysis of any type including constructors, properties, methods, and enums

Your Personal SDK Exploration Workspace

  • Add any NuGet package to explore
  • Accumulate packages over time for comparison
  • See how different SDKs structure their APIs
  • Learn from well-designed libraries

Deep Type Analysis

  • Constructors with parameter details
  • Properties with get/set accessibility
  • Methods with return types and parameters
  • Enum values with numeric values
  • Interface implementations
  • Static vs instance members
  • Async method detection

🚀 Installation & Setup

Clone and Build

git clone https://github.com/sojohnnysaid/ReflectionExplorer.git
cd ReflectionExplorer
dotnet build

📖 Usage

Basic Usage

# Run the interactive explorer
dotnet run

# Run in demo mode (non-interactive)
dotnet run demo

Adding Packages to Explore

The real power comes from adding NuGet packages to explore:

# Add any NuGet package
dotnet add package Newtonsoft.Json
dotnet add package Serilog
dotnet add package Microsoft.EntityFrameworkCore

# Run the explorer
dotnet run

Interactive Menu Options

  1. List namespaces - See all namespaces in loaded assemblies
  2. Explore specific namespace - Browse all types in a namespace
  3. Search for types - Find types by partial name match
  4. Analyze specific type - Deep dive into a type's members
  5. Show all types - Complete type listing organized by namespace
  6. List loaded assemblies - See what's currently loaded

🔍 Example Workflow

Exploring a Sign SDK

# Add the SDK package
dotnet add package Conga.Sign.SDK --version 202508.1.3

# Run the explorer
dotnet run

# In the menu:
# - Choose option 4 to search
# - Type "sign" to find all Sign-related types
# - Select a type like "CongaSignConfig" to analyze
# - See all its properties, methods, and constructors

Comparing Authentication Patterns

# Add multiple auth libraries
dotnet add package Auth0.AuthenticationApi
dotnet add package Microsoft.Identity.Client
dotnet add package IdentityModel

# Run and search for "auth" to compare their approaches
dotnet run

🎨 Output Format

The tool uses color coding and icons for clarity:

Type Icons

  • 📘 Regular Class
  • 🔒 Static Class
  • 🎨 Abstract Class
  • 🔌 Interface
  • 📝 Enum
  • 📦 Struct

Color Coding

  • Yellow - Constructors and section headers
  • Green - Properties
  • Cyan - Methods and namespaces
  • Magenta - Enum values

💡 When to Use This vs PackageAnalyzer

Use PackageAnalyzer when you want to: Use Reflection Explorer when you want to:
Get a quick overview of a package Interactively explore types
See all types at once Search for specific functionality
Generate a report of package contents Understand relationships between types
Analyze packages you don't have locally Work with packages in your development environment
One-time package inspection Build a collection of packages to reference

🔧 Advanced Tips

Building Your SDK Knowledge Base

# Create a dedicated exploration project
mkdir MySDKExplorer
cd MySDKExplorer
dotnet new console
cp /path/to/ReflectionExplorer/Program.cs .

# Add all the SDKs you work with
dotnet add package Azure.Storage.Blobs
dotnet add package AWS.SDK.S3
dotnet add package Google.Cloud.Storage.V1

# Now you have a searchable knowledge base
dotnet run

Searching Effectively

  • Use partial names: "config" finds all configuration classes
  • Search for patterns: "client" finds all client classes
  • Look for interfaces: "I" prefix often indicates interfaces
  • Find enums: search for "type" or "status" or "mode"

🤝 Contributing

Contributions are welcome! Some ideas for enhancements:

  • Export findings to markdown/JSON
  • Compare two versions of the same package
  • Generate code snippets from discoveries
  • Add regex search support
  • Filter by access modifiers

📄 License

MIT License - see LICENSE file for details

🙏 Acknowledgments

  • Companion tool to PackageAnalyzer
  • Built with .NET Reflection API
  • Inspired by the need to understand third-party SDKs deeply

🐛 Known Issues

  • Some internal types may not be visible due to access modifiers
  • Very large assemblies might take a moment to load
  • Generic type constraints are not fully displayed

📮 Feedback

Found a bug or have a feature request? Please open an issue on GitHub!


Remember: This tool is for learning and exploration. Once you understand an SDK, you can remove it from your ReflectionExplorer project or keep it for future reference. Think of it as your personal SDK laboratory! 🧪

About

Interactive CLI tool for deep exploration of .NET assemblies and NuGet packages using reflection

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages