.agents/skills/issue-repro/references/platform-windows-desktop.md
Reproduce bugs in WPF, WinForms, WinUI, or UWP applications using SkiaSharp.
⚠️ Requires Windows host. If the current host is macOS or Linux, try the console fallback first — many "WPF bugs" are actually core SkiaSharp bugs reproducible anywhere.
WPF, WinForms, WinUI 3, UWP, ClickOnce, XPS, GDI+, SkiaSharp.Views.WPF,
SkiaSharp.Views.WindowsForms, SKElement, SKXamlCanvas, Windows-specific HWND,
System.Windows, System.Drawing interop.
dotnet workload install windowsdesktop (if needed)Try console fallback first. Read platform-console.md and attempt a console
reproduction. If the bug is in core SkiaSharp (e.g., wrong pixel values, codec errors,
path calculations), it will reproduce in a console app regardless of the UI framework.
Try Docker Linux. Read platform-docker-linux.md — some bugs manifest on both
Windows and Linux (e.g., native library loading, font resolution).
If neither works: Record needs-platform with blocker:
"Requires Windows host — bug is in WPF/WinForms view layer, not reproducible via console or Docker."
# WPF
dotnet new wpf -n Repro --framework {reporter_tfm}
cd Repro
dotnet add package SkiaSharp.Views.WPF --version {reporter_version}
# WinForms
dotnet new winforms -n Repro --framework {reporter_tfm}
cd Repro
dotnet add package SkiaSharp.Views.WindowsForms --version {reporter_version}
<skia:SKElement PaintSurface="OnPaintSurface" /> to XAMLSKControl to form, wire up PaintSurfacedotnet build
dotnet run
WPF/WinForms apps open a window — visual inspection or programmatic assertions required.
| Observation | Conclusion |
|---|---|
| Bug reproduced on console (no Windows needed) | reproduced (platform-console) |
| Bug requires Windows UI layer | needs-platform (if host is not Windows) |
| Bug reproduced on Windows host | reproduced |
For Windows desktop bugs, Phase 3C uses the repo's WPF or WinUI sample:
# Return to the SkiaSharp repo root
cd "$(git rev-parse --show-toplevel)"
[ -d "output/native" ] && ls output/native/ | head -5 || dotnet cake --target=externals-download
# WPF sample (project references local SkiaSharp + Views.WPF source)
dotnet build samples/Basic/WPF/SkiaSharpSample/SkiaSharpSample.csproj
dotnet run --project samples/Basic/WPF/SkiaSharpSample/SkiaSharpSample.csproj
# WinUI sample
dotnet build samples/Basic/WinUI/SkiaSharpSample/SkiaSharpSample.csproj
dotnet run --project samples/Basic/WinUI/SkiaSharpSample/SkiaSharpSample.csproj
If host is not Windows: You can still BUILD these samples (to verify compilation). Run
requires Windows — record result: "not-tested" for runtime if no Windows host available,
but record result: "success" / "failure" for the build step.
Temporarily modify the sample's drawing code to match the reporter's repro, then revert
with git checkout after recording the result.