Ansight.Tools.Reflection 0.1.0-pre3

This is a prerelease version of Ansight.Tools.Reflection.
dotnet add package Ansight.Tools.Reflection --version 0.1.0-pre3
                    
NuGet\Install-Package Ansight.Tools.Reflection -Version 0.1.0-pre3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ansight.Tools.Reflection" Version="0.1.0-pre3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ansight.Tools.Reflection" Version="0.1.0-pre3" />
                    
Directory.Packages.props
<PackageReference Include="Ansight.Tools.Reflection" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ansight.Tools.Reflection --version 0.1.0-pre3
                    
#r "nuget: Ansight.Tools.Reflection, 0.1.0-pre3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ansight.Tools.Reflection@0.1.0-pre3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ansight.Tools.Reflection&version=0.1.0-pre3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Ansight.Tools.Reflection&version=0.1.0-pre3&prerelease
                    
Install as a Cake Tool

Ansight.Tools.Reflection

Grouped live-object reflection tools for the Ansight .NET SDK.

Registered tools:

  • reflect.list_roots
  • reflect.inspect_object
  • reflect.describe_type
  • reflect.set_member_value
  • reflect.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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

  • net9.0-android35.0

  • net9.0-ios18.0

  • net9.0-maccatalyst18.0

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