Skip to content

Add .NET Framework 4.7.2 Inspector support - #20

Closed
miloszkukla wants to merge 3 commits into
faze79:mainfrom
miloszkukla:agent/add-net472-support
Closed

miloszkukla wants to merge 3 commits into
faze79:mainfrom
miloszkukla:agent/add-net472-support

Conversation

@miloszkukla

@miloszkukla miloszkukla commented Aug 13, 2026

Copy link
Copy Markdown

Important

This is the base of the code stack. Please merge it with a merge commit so #18 and #21 retain the same shared commit IDs and their cumulative diffs shrink without cherry-picking.

Summary

  • add net472 to the Shared and Inspector target framework matrices
  • keep InjectorHelper on net8.0; it launches and injects the Inspector but is not referenced by target applications
  • apply the existing .NET Framework package and WPF references to both net472 and net48
  • add a Shared-only test project that runs unchanged tests against net472, net48, and net8.0
  • document the Inspector's supported self-hosting targets

Why

A .NET Framework 4.7.2 WPF project cannot reference the existing net48 Inspector target at compile time. Adding a dedicated net472 target enables self-hosting without retargeting the application.

This keeps net48 rather than replacing it, preserving the existing injection payload and making support for .NET Framework 4.7.2, .NET Framework 4.8, and .NET 8 explicit.

Validation

  • dotnet build src/WpfVisualTreeMcp.Inspector/WpfVisualTreeMcp.Inspector.csproj --configuration Release --framework net472 — succeeded with 0 errors
  • dotnet build WpfVisualTreeMcp.sln --configuration Release — succeeded with 0 errors and compiled every declared Shared and Inspector target
  • WpfVisualTreeMcp.Shared.Tests — 19 passed on each of net472, net48, and net8.0
  • remaining existing tests — 55 passed
  • clean temporary merge with Fix Auto-injection packaging for release artifacts #18; combined Release solution build succeeded with 0 errors
  • combined native bootstrapper builds succeeded for x64 and Win32; the local v145 override was command-line only and the project remains on v143
  • combined server publish and NuGet pack succeeded; the package retains the net48 Inspector, dependency closure, and native bootstrapper under both native/x64 and native/x86
  • git diff --check

@miloszkukla
miloszkukla force-pushed the agent/add-net472-support branch from a8885e6 to 77d304d Compare August 13, 2026 23:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds explicit .NET Framework 4.7.2 support to the Inspector + Shared libraries so older WPF apps can self-host the Inspector via project reference, and introduces a Shared-only test project to validate behavior across net472/net48/net8.0.

Changes:

  • Multi-target WpfVisualTreeMcp.Shared and WpfVisualTreeMcp.Inspector for net472 alongside existing net48 and net8.0(-windows) targets, including framework-conditional references/packages.
  • Add WpfVisualTreeMcp.Shared.Tests to run Shared regression tests across net472, net48, and net8.0.
  • Update docs to describe the Inspector’s supported self-hosting target frameworks; simplify Injector to net8.0 only.

Reviewed changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
WpfVisualTreeMcp.sln Adds the new Shared-only test project to the solution.
tests/WpfVisualTreeMcp.Shared.Tests/WpfVisualTreeMcp.Shared.Tests.csproj New multi-targeted test project validating Shared across net472/net48/net8.0.
tests/WpfVisualTreeMcp.Shared.Tests/SharedModelsTests.cs New Shared model construction/assertion tests.
tests/WpfVisualTreeMcp.Shared.Tests/IpcSerializerTests.cs New IPC envelope regression tests (multi-targeted).
src/WpfVisualTreeMcp.Shared/WpfVisualTreeMcp.Shared.csproj Adds net472 target and applies .NET Framework package refs to both net472 and net48.
src/WpfVisualTreeMcp.Inspector/WpfVisualTreeMcp.Inspector.csproj Adds net472 target and applies explicit WPF refs to both net472 and net48.
src/WpfVisualTreeMcp.Injector/WpfVisualTreeMcp.Injector.csproj Simplifies Injector to target net8.0 only.
README.md Documents Inspector’s multi-target support and updates the repo tree description.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 3 to 5
<PropertyGroup>
<!--
Multi-targeted so the x86 InjectorHelper (net8.0) can reference us without
a cross-TFM warning. .NET Framework 4.8 stays around so the existing server
build path is unchanged.
-->
<TargetFrameworks>net48;net8.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Library</OutputType>

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessed in consolidated PR #22 and intentionally unchanged. Injector no longer references the Windows-targeted Inspector assembly; moving Injector to net8.0-windows would also force the referencing Server/tool TFM to change. The Windows runtime requirement is documented explicitly.

@miloszkukla

Copy link
Copy Markdown
Author

Superseded by #22, which consolidates the full change set and incorporates the applicable review feedback. Closing this stacked PR to avoid duplicate review threads and workflow ambiguity.

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.

2 participants