Conversation
Add an lvt plugin that detects and dumps the visual tree of Avalonia
desktop applications. The plugin follows the same injection pattern as
the WPF provider:
1. Plugin DLL (lvt_avalonia_plugin.dll) - detects Avalonia.Base.dll in
the target process, injects the TAP DLL, reads tree JSON via named
pipe.
2. TAP DLL (lvt_avalonia_tap_x64.dll) - native DLL injected into the
target process. Hosts .NET CLR via hostfxr and calls the managed
tree walker.
3. Managed tree walker (LvtAvaloniaTreeWalker.dll) - walks the Avalonia
visual tree via Visual.VisualChildren (using reflection), serializes
type names, bounds, text content, visibility, and element names to
JSON.
Also includes:
- Simple Hello World Avalonia test app (tests/avalonia_test_app/)
- CMake build targets for the plugin and TAP DLL
- Fix plugin graft code to prefer 'text' over 'name' JSON field
Tested end-to-end: detects Avalonia 11.2.7, dumps 37-element tree with
TextBlock ('Hello World'), Button ('Click Me'), TextBox elements.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add docs/avalonia-plugin.md with installation, usage, and architecture - Update README.md: mention Avalonia in framework list, add Optional plugins table under Plugin system section - Update docs/architecture.md: add Avalonia to framework detection table Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The POST_BUILD copy command for the Avalonia TAP DLL expects the managed LvtAvaloniaTreeWalker.dll to already exist. Add a dotnet build step before cmake --build in both CI and release workflows. Also include the plugins/ directory in CI artifacts and release packages. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace copy_if_different with 'dotnet publish -o <dir>' to place the managed assembly directly in the build output. This avoids failures when the bin/Release/ output path doesn't match expectations across different .NET SDK versions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an lvt plugin that detects and dumps the visual tree of Avalonia UI desktop applications.
Components
lvt_avalonia_plugin.dll) - C ABI plugin detectingAvalonia.Base.dllin the target process, injecting the TAP DLL, reading tree JSON via named pipelvt_avalonia_tap_x64.dll) - native DLL injected into the target process; hosts .NET CLR via hostfxr to call the managed tree walker; unloads itself viaFreeLibraryAndExitThreadafter collectionLvtAvaloniaTreeWalker.dll) - walks Avalonia'sVisual.VisualChildrenvia reflection, serializes type names, bounds, text content, visibility to JSONtests/avalonia_test_app/) - simple Hello World Avalonia desktop app with TextBlock, Button, TextBoxdocs/avalonia-plugin.mdwith installation/usage; README and architecture docs updatedBug fix
Updated
plugin_loader.cppgraft code to prefer thetextovernameJSON field when setting element text, matching how the WPF provider's graft works.Testing