Skip to content

Add managed C# AppMap agent (under managed/)#34

Draft
evlawler wants to merge 1 commit into
masterfrom
claude/exciting-ritchie-ksbydi
Draft

Add managed C# AppMap agent (under managed/)#34
evlawler wants to merge 1 commit into
masterfrom
claude/exciting-ritchie-ksbydi

Conversation

@evlawler

@evlawler evlawler commented Jun 25, 2026

Copy link
Copy Markdown

What this is

This PR brings the fully managed C# AppMap agent into appmap-dotnet under a new managed/ subdirectory. It's a from-scratch port of the appmap-java architecture — a managed agent that rewrites methods at runtime via Harmony, rather than instrumenting IL from a C++ CLR-profiler plugin.

The motivation (vs. the existing C++ prototype): being fully managed makes it cross-platform (not Linux-only) and considerably easier to evolve, while emitting the same AppMap JSON (format v1.2) as appmap-java.

Layout

Everything lands under managed/the existing C++ prototype and its CI are untouched, so the two implementations sit side by side for comparison. (The agent's own CI workflows are at managed/.github/workflows/ and therefore do not auto-run in this repo.)

Project Role
managed/src/AppMap.Agent Config, recorder, event model, serializer, Harmony instrumentation, SQL + built-in hooks
managed/src/AppMap.Attributes [Labels] attribute for application code
managed/src/AppMap.StartupHook DOTNET_STARTUP_HOOKS entry point
managed/src/AppMap.AspNetCore HTTP server events, request + remote recording
managed/src/AppMap.SystemWeb The same for classic ASP.NET (.NET Framework)
managed/src/AppMap.Testing.{Xunit,NUnit} One AppMap per test
managed/test/AppMap.Agent.Tests Serializer / config / value-capture unit tests
managed/examples/{HelloAppMap,PetClinic} Smallest recorded app; ASP.NET Core + EF Core web app (HTTP + SQL)
managed/harness/ Records an unmodified real app (eShopOnWeb) and CLI-validates the maps

See managed/README.md for build/usage and managed/DESIGN.md for the design.

Status

Draft, opened for @dividedmind to review the approach. Imported as-is from the prototyping repo; happy to reshape placement, naming, or split it up based on feedback.

Imports the fully managed .NET AppMap agent (a from-scratch C# port of
appmap-java's architecture) developed in the Fun-with-Appmap-and-Claude
repo. Placed under managed/ alongside the existing C++ CLR-profiler
prototype so the two implementations can be compared without disturbing
the prototype or its CI.

Includes the agent (config, recorder, event model, serializer, Harmony
instrumentation, SQL/built-in hooks), startup hook, ASP.NET Core and
System.Web integrations, xUnit/NUnit test recorders, examples
(HelloAppMap, PetClinic), unit tests, and the eShopOnWeb harness.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R1CtA2aMGjPuRYpfv2VcaX
@evlawler evlawler requested a review from dividedmind June 25, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant