Update CsWin32 and analyzer dependencies while preserving compiler compatibility - #869
Conversation
…patibility Adapt shell icon acquisition to the typed CsWin32 overload, retain the shipped analyzer's Roslyn 4.8 baseline, and add compatibility and icon lifetime regression coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved blocking issues were identified, and compatibility coverage was added.
Pull request overview
Updates CsWin32 and analyzer/test dependencies while preserving Roslyn 4.8 compatibility for shipped analyzers.
Changes:
- Adapts shell-icon acquisition to the typed CsWin32 API.
- Strengthens icon lifetime, serialization, and analyzer compatibility tests.
- Updates dependency versions and prevents automatic Roslyn baseline bumps.
File summaries
| File | Description |
|---|---|
src/winapp-CLI/WinApp.Cli/Helpers/ShellIcon.cs |
Uses typed IImageList2 acquisition. |
src/winapp-CLI/WinApp.Cli.Tests/ShellIconTests.cs |
Adds repeated acquisition and serialization coverage. |
src/winapp-CLI/Directory.Packages.props |
Updates CsWin32 and related dependencies. |
src/winapp-Analyzer/Microsoft.WindowsAppSDK.Analyzers/Microsoft.WindowsAppSDK.Analyzers.csproj |
Retains the Roslyn 4.8 analyzer reference. |
src/winapp-Analyzer/Microsoft.WindowsAppSDK.Analyzers.Tests/Microsoft.WindowsAppSDK.Analyzers.Tests.csproj |
Updates analyzer test dependencies to Roslyn 5.9. |
src/winapp-Analyzer/Microsoft.WindowsAppSDK.Analyzers.Tests/AnalyzerCompatibilityTests.cs |
Verifies shipped analyzer assembly references. |
.github/dependabot.yml |
Excludes Roslyn compiler references from automatic updates. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 0
- Review effort level: Lite (auto)
Note
Copilot is running an experiment and ran this review at Lite.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Build Metrics ReportBinary Sizes
Test Results✅ 7178 passed, 37 skipped out of 7215 tests in 1429.6s (+321.6s vs. baseline) Test Coverage✅ 85.9% line coverage, 80% branch coverage · ✅ no change vs. baseline CLI Startup Time61ms median (x64, Try This BuildInstalls the MSIX for your architecture, replacing any previously installed build. Needs the GitHub CLI — the command offers to install it and sign you in if it is missing. & ([scriptblock]::Create((irm https://raw.githubusercontent.com/microsoft/winappCli/main/scripts/winapp-pr.ps1))) 869Switching between builds often?Put the tool on your PATH once: & ([scriptblock]::Create((irm https://raw.githubusercontent.com/microsoft/winappCli/main/scripts/winapp-pr.ps1))) -AddToPathThen this build is just: winapp-pr 869Run Updated 2026-09-17 20:54:12 UTC · commit |
Description
Manually adopt the dependency updates from #855 and #857 with the required CsWin32 API adaptation and compatibility coverage.
Both Dependabot PRs failed to compile because CsWin32 0.3.333 replaces the
SHGetImageListconvenience overload used by the CLI. Use its typedout IImageList2overload and strengthen the shell-icon test to verify repeated acquisition and serialization after native handles are released.Update Microsoft.NET.Test.Sdk to 18.10.0, xunit.v3 and xunit.runner.visualstudio to 4.0.0, Microsoft.CodeAnalysis.Analyzers to 5.9.0, and the test host's Microsoft.CodeAnalysis.CSharp to 5.9.0. Keep the shipped analyzer's Microsoft.CodeAnalysis.CSharp reference at 4.8.0 so older supported compilers can still load it. Add assembly-reference regression tests and exclude that package from automatic Dependabot bumps.
Usage Example
No public commands, flags, configuration formats, or library APIs change. Existing executable-icon extraction continues to work:
Related Issue
Supersedes #855 and #857. The production Roslyn bump in those PRs is intentionally omitted to preserve the supported compiler baseline.
Type of Change
Checklist
Screenshots / Demo
Not applicable: no intended UI or CLI behavior change.
Additional Notes
Validation
scripts\build-cli.ps1 -SkipTestsscripts\validate-llm-docs.ps1The build script's test phase was skipped because the dependency-focused suites above were run separately; the full CLI suite was not run.
Published-binary and consumer checks
Tested both published binaries on an ARM64 Windows host: ARM64 natively and x64 under emulation. Both successfully extracted an executable's icon and generated 49 assets, inspected a dedicated test window, round-tripped a text value, captured nonblank screenshots, and recorded six-frame WGC/H.264 videos with JPEG evidence. Checked output dimensions, frame manifests, changing image content, and finalized MP4 sample tables.
Fresh consumers of the packaged
net10.0-windowsandnet10.0-windows10.0.19041.0library targets restored, compiled with warnings as errors, and ran. The lean target retained GDI-only capture; the full target exposed WGC and recording. CsWin32 was absent from the consumers' transitive dependency graph.No downstream break was found in these tested paths; x64 hardware execution and opt-in live pointer injection were not covered.