Ansight.Tools.Reflection
0.1.0-pre3
dotnet add package Ansight.Tools.Reflection --version 0.1.0-pre3
NuGet\Install-Package Ansight.Tools.Reflection -Version 0.1.0-pre3
<PackageReference Include="Ansight.Tools.Reflection" Version="0.1.0-pre3" />
<PackageVersion Include="Ansight.Tools.Reflection" Version="0.1.0-pre3" />
<PackageReference Include="Ansight.Tools.Reflection" />
paket add Ansight.Tools.Reflection --version 0.1.0-pre3
#r "nuget: Ansight.Tools.Reflection, 0.1.0-pre3"
#:package Ansight.Tools.Reflection@0.1.0-pre3
#addin nuget:?package=Ansight.Tools.Reflection&version=0.1.0-pre3&prerelease
#tool nuget:?package=Ansight.Tools.Reflection&version=0.1.0-pre3&prerelease
Ansight.Tools.Reflection
Grouped live-object reflection tools for the Ansight .NET SDK.
Registered tools:
reflect.list_rootsreflect.inspect_objectreflect.describe_typereflect.set_member_valuereflect.invoke_method
Usage
using Ansight;
using Ansight.Tools.Reflection;
var session = new DebugSessionViewModel();
var options = Options.CreateBuilder()
.WithReflectionTools(reflection =>
{
reflection.WithDefaultMemberVisibility(ReflectionMemberVisibility.PublicOnly);
})
.WithReadWriteToolAccess()
.Build();
using var sessionRoot = ReflectionRootRegistry.Register(
"session",
session,
new ReflectionRootMetadata("Current Session")
{
Description = "Active session view model",
Hints = ["debug", "session"]
});
using var detailRoot = ReflectionRootRegistry.Register(
"details",
() => session.CurrentDetails,
new ReflectionRootMetadata("Current Details"));
detailRoot.Deregister();
Registering a root grants access to visible members and instance methods reachable from that root. The tools use stateless paths from registered roots; there are no per-member allow-list APIs in the current simplified surface. Choose the roots you expose carefully, and choose an appropriate tool guard.
Direct object roots use weak references by default when registered with Register(...). Pass ReferenceType.Strong when the registry should retain the root for the lifetime of the toolsuite. Register a Func<object?> getter when the exposed root can change over time, such as the current view model or selected document; the root is reported as unavailable while the getter returns null. Runtime registration returns a ReflectionRootRegistrationHandle; dispose it or call Deregister() to remove that specific registration, or call ReflectionRootRegistry.Deregister(id) to remove the current root by identifier. Metadata, including Description and Hints, is supplied through the ReflectionRootMetadata argument.
Recursive traversal is open by default. Use WithAssemblyTraversalMode(ReflectionAssemblyTraversalMode.AllowListedOnly) and WithNamespaceTraversalMode(ReflectionNamespaceTraversalMode.AllowListedOnly) with AllowAssembly(...) / AllowNamespacePrefix(...) only when you need to restrict expansion to selected assemblies or namespaces.
WithReadOnlyToolAccess() exposes reflect.list_roots, reflect.inspect_object, and reflect.describe_type. reflect.set_member_value and reflect.invoke_method are write-scoped and require WithReadWriteToolAccess() or a custom ToolGuard.
These tools are intended for local debugging only and may expose or mutate sensitive runtime state.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-android35.0 is compatible. net9.0-browser was computed. net9.0-ios was computed. net9.0-ios18.0 is compatible. net9.0-maccatalyst was computed. net9.0-maccatalyst18.0 is compatible. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-pre3 | 36 | 4/21/2026 |
| 0.1.0-pre2 | 66 | 4/4/2026 |
| 0.1.0-pre1 | 62 | 3/31/2026 |