Repository navigation
fix(samples): remove ImageSharp from ChatRoom - #11445
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The focused dependency removal is complete and preserves the sample’s documented functionality.
0 open findings
What changed in this PR
Removes the vulnerable, decorative ImageSharp dependency from the ChatRoom sample while preserving its Spectre.Console instructions.
Changes:
- Removes ImageSharp packages, logo resource, and rendering code.
- Simplifies startup output to a single-column text layout.
- Updates README wording for the retained legacy screenshot.
| File | Description |
|---|---|
samples/ChatRoom/ChatRoom.Client/ChatRoom.Client.csproj |
Removes ImageSharp references and logo embedding. |
samples/ChatRoom/ChatRoom.Client/Program.cs |
Removes image loading and simplifies startup rendering. |
samples/ChatRoom/ChatRoom.Client/logo.png |
Deletes the unused decorative logo. |
samples/ChatRoom/Directory.Packages.props |
Removes ImageSharp version pins. |
samples/ChatRoom/README.md |
Documents the text display and legacy screenshot. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
09755b0 to
f475108
Compare
Code coverage
Report-only conclusion: current-main baseline stale. The newest successful coverage run tested 165acd0, not current main 7566978. Coverage combines every CI test matrix job, including providers, CodeGen, .NET 8/10, Linux, Windows, and macOS, using canonical physical source and branch identities. The comparison remains report-only while normal line and branch variance is calibrated. Coverage details |
(cherry picked from commit 7566978) Upstream-PR: dotnet#11445 Upstream-Commit: 7566978
(cherry picked from commit 7566978) Upstream-PR: dotnet#11445 Upstream-Commit: 7566978
(cherry picked from commit 7566978) Upstream-PR: dotnet#11445 Upstream-Commit: 7566978

The Documentation sample build fails because NuGet audit flags the ChatRoom client's pinned ImageSharp version. ImageSharp is used only to render the startup logo, so the sample can preserve its appearance using pre-rendered terminal markup and eliminate image processing dependencies.
Embed
logo.markup.gz, containing plain UTF-8 Spectre.Console markup compressed with gzip, and retainlogo.pngas the source artwork. The 3,887-byte resource includes 25 pre-rendered sizes separated by form feeds, preserving the existing colors and two-column layout as the terminal narrows. Loading uses built-in .NETGZipStreamandStreamReader, with no JSON serialization.Remove both ImageSharp package references and central version pins. Add a README example for regenerating the resource from the PNG using a one-off converter. The converter's ImageSharp license terms apply; building and running the sample require only its remaining dependencies. NuGet audit and warning-as-error enforcement remain enabled.
Fixes: #11437
Microsoft Reviewers: Open in CodeFlow