Ansight.Tools.Reflection 0.1.0-pre1

This is a prerelease version of Ansight.Tools.Reflection.
dotnet add package Ansight.Tools.Reflection --version 0.1.0-pre1
                    
NuGet\Install-Package Ansight.Tools.Reflection -Version 0.1.0-pre1
                    
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-pre1" />
                    
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-pre1" />
                    
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-pre1
                    
#r "nuget: Ansight.Tools.Reflection, 0.1.0-pre1"
                    
#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-pre1
                    
#: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-pre1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Ansight.Tools.Reflection&version=0.1.0-pre1&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);
        reflection.WithAssemblyTraversalMode(ReflectionAssemblyTraversalMode.AllowAll);
        reflection.WithNamespaceTraversalMode(ReflectionNamespaceTraversalMode.AllowAll);
        reflection.AddRoot(
            "session",
            session,
            new ReflectionRootMetadata("Current Session")
            {
                Description = "Active session view model",
                Hints = ["debug", "session"],
                ContainsSensitiveData = true
            },
            root => root
                .AllowWritableMembers("SelectedTab")
                .AllowAllWritableMembersOn<DebugSessionViewModel>()
                .AllowInvokableMethods("Refresh()")
                .AllowAllInvokableMethodsOn<DebugSessionViewModel>());
    })
    .WithReadWriteToolAccess()
    .Build();

Direct object roots use weak references by default. Use AddStrongRoot(...) when the root should be retained for the lifetime of the toolsuite.

Recursive traversal is allow-listed by default. Use WithAssemblyTraversalMode(...) and WithNamespaceTraversalMode(...) to switch either boundary to AllowAll, or keep the default AllowListedOnly mode and add entries with AllowAssembly(...) / AllowNamespacePrefix(...).

Write and invoke operations are explicitly allow-listed per root:

  • writable members are matched by relative member path such as Child.Name
  • invokable methods are matched by Method(Type) for root methods or Path#Method(Type) for nested targets
  • AllowAllWritableMembersOn<T>() / AllowAllInvokableMethodsOn<T>() enable all writable members or invokable methods for reachable objects assignable to a given type
  • AllowAllWritableMembers() / AllowAllInvokableMethods() enable those capabilities for all reachable objects under the root

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-pre1 25 3/31/2026