Help us improve
Share bugs, ideas, or general feedback.
Share bugs, ideas, or general feedback.
Share bugs, ideas, or general feedback.
By shinyorg
Generate AOT-compliant source code that replaces runtime reflection in .NET apps, providing zero-allocation dynamic property access, JSON serialization, and assembly metadata from build properties via Shiny Reflector.
npx claudepluginhub shinyorg/reflector --plugin shiny-reflectorReflection is awesome and super powerful, but also very slow and non-AOT compliant. Using source generators, we look to solve some of those pain points. This library gives you the power of reflection... without the actual reflection!
reflector is not availableUsing the following attribute and marking your class as partial
[Shiny.Reflector.ReflectorAttribute]
public partial class MyClass
{
public int MyProperty { get; set; }
public string Message { get; set;}
}
[!NOTE] Works on records as well, but you must use the
partialkeyword and attribute just like a class.
Just that attribute allows you to do this:
var myClass = new MySampleClass
{
Name = "Hello World",
Age = null
};
// NOTE: the use of GetReflector - a reflector class is generated for each class marked with the ReflectorAttribute
var reflector = myClass.GetReflector();
foreach (var prop in reflector.Properties)
{
var objValue = reflector[prop.Name];
Console.WriteLine($"Property: {prop.Name} ({prop.Type}) - Current Value: {objValue}");
}
// generics for type casting
var name = reflector.GetValue<string>("Name");
Console.WriteLine("Reflector Name: " + name);
// indexers for loose typing
Console.WriteLine("Reflector Value: " + reflector["age"]);
// set with generics
reflector.SetValue("Age", 99);
// or just an object on the indexer
reflector["name"] = "Something Else";
Console.WriteLine("Reflector Name Value: " + reflector["NaMe"]);
Console.WriteLine("Reflector Age Value: " + reflector["NaMe"]);
You can also generate assembly information for your project by adding the following attribute to your AssemblyInfo.cs file:
In your project file, you can add the following property to enable the generation of assembly info:
<Project>
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<MyCustomVar>Hello World</MyCustomVar>
</PropertyGroup>
<ItemGroup>
<ReflectorItem Include="MyReflectorItem"
Value="This is a sample value"
Visible="false" />
<!--capture a build variable that we don't look for-->
<ReflectorItem Include="PropertyGroupMyCustomVar"
Value="$(MyCustomVar)"
Visible="false" />
</ItemGroup>
</Project>
And a new AssemblyInfo static class with constants will be generated for you (NOTE: it grabbed defaulted variables like Company, Version, etc. from the project file):
public static class AssemblyInfo
{
public const string Company = "Samples";
public const string Version = "1.0.0";
public const string TargetFramework = "net9.0";
public const string TargetFrameworkVersion = "v9.0";
public const string Platform = "AnyCPU";
public const string MyReflectorItem = "This is a sample value";
public const string PropertyGroupMyCustomVar = "Hello World";
}
and now you can do easy things like this:
Console.WriteLine("Target Framework: " + AssemblyInfo.TargetFramework);
Console.WriteLine("My Custom Var: " + AssemblyInfo.PropertyGroupMyCustomVar);
If you are using the Community Toolkit MVVM and more specifically, the source generation that it uses. You need to do the following Reflector detects your properties.
In your csproj file, add the following:
<PropertyGroup>
<LangVersion>preview</LangVersion>
</PropertyGroup>
Now, in your ObservableObject class, you can use the Reflector attribute. Note properties use the newer C# partial properties keyword.
[Shiny.Reflector.ReflectorAttribute]
public partial class MyObservableObject : ObservableObject
{
[ObservableProperty]
public partial string MyProperty { get; set; }
}
Share bugs, ideas, or general feedback.
Based on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Inspect .NET assemblies and NuGet packages
Roslyn-powered C# refactoring MCP server — 41 tools for code navigation, analysis, generation, and refactoring across entire .NET solutions
Claude Code plugin for Shiny Mediator - a mediator pattern implementation for .NET applications with AOT/trimming support, source generators, and rich middleware pipeline
Comprehensive .NET development skills for modern C#, ASP.NET, MAUI, Blazor, Aspire, EF Core, Native AOT, testing, security, performance optimization, CI/CD, and cloud-native applications
Autonomous C#/.NET code review — fail-fast pipeline with mechanical checks + AI sub-agents (performance, architecture, correctness, UI/Blazor)
Claude Code plugin for Shiny MAUI Shell - enhanced .NET MAUI Shell navigation with ViewModel lifecycle management, source generation, and strong-typed navigation
Claude Code plugin for Shiny Mediator - a mediator pattern implementation for .NET applications with AOT/trimming support, source generators, and rich middleware pipeline
Claude Code plugin for Shiny MAUI Shell - enhanced .NET MAUI Shell navigation with ViewModel lifecycle management, source generation, and strong-typed navigation
Claude Code plugin for Shiny Health - cross-platform health data queries for Apple HealthKit and Android Health Connect in .NET MAUI
Claude Code plugin for Shiny Extensions - dependency injection with source generators, source-generated reflection, cross-platform key/value stores and repositories, and ASP.NET infrastructure modules for .NET applications
Claude Code plugin for Shiny.Permissions.MSBuild - declare high-level MAUI permissions or fine-grained Android manifest and iOS Info.plist entries via MSBuild items
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claim