Repository navigation
Pin ImGui.App's Resources.resx manifest name, and guard every .resx against drift - #429
Merged
Merged
Conversation
… .resx ImGui.App/Resources/Resources.resx had no LogicalName, so its manifest name was derived from RootNamespace, which ktsu.Sdk computes from AuthorsNamespace and ProjectNamespace, while Resources.Designer.cs looks the name up from a string literal baked in when it was last generated. The two can drift apart silently; the first lookup then throws MissingManifestResourceException at run time. That already happened once in examples/ImGuiAppDemo (08d9b60), and here it would take NerdFont and NotoEmoji down in every consuming application. Pin the name the designer already looks up, mirroring the demo fix, and add EmbeddedResourceManifestNameTests so the class is closed rather than fixed one file at a time: it walks every .resx in the repository, requires an explicit EmbeddedResource item with a LogicalName, requires that LogicalName to match the name its designer looks up, and checks the shipped assembly really embeds it and that both fonts decode. The pinned value is what the build already produced, so the assembly is byte-for-byte unchanged today; the point is that a future RootNamespace change now fails a test instead of a consumer's font loading. Fixes #421 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EGcveAXKn6XZnHU2G9jrro
…mbine Code quality flagged both Path.Combine calls in EmbeddedResourceManifestNameTests for silently dropping their earlier argument when the later one is rooted. The repository-root walk joins a constant filename, so Path.Join says what it means. The item-spec resolution genuinely has two cases — MSBuild reads a spec relative to the project unless it is already rooted — so branch on Path.IsPathRooted and resolve each one explicitly. Behaviour for the relative specs both projects actually use is unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EGcveAXKn6XZnHU2G9jrro
…lePath Test on macos-latest failed both source-scanning tests with "Could not locate the repository root". CI builds with deterministic source paths, which rewrites CallerFilePath to /_/tests/ImGui.App.Tests/..., so the walk had nothing on disk to climb. Reproduced locally with -p:ContinuousIntegrationBuild=true, which fails identically. Walk up from AppContext.BaseDirectory instead: the binaries live under tests/<project>/bin/<configuration>/<tfm>, inside the checkout either way. CallerFilePath stays as a fallback for a run whose output was moved out of the repository. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EGcveAXKn6XZnHU2G9jrro
|
This was referenced Sep 21, 2026
This was referenced Sep 29, 2026
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.



Fixes #421
What was wrong
ImGui.App/Resources/Resources.resxhad no<LogicalName>on itsEmbeddedResourceitem, so its manifest name was derived fromRootNamespace— whichktsu.Sdkcomputes fromAuthorsNamespace/ProjectNamespace— whileResources.Designer.cslooks the name up from a string literal baked in when it was last generated. Nothing keeps the two in step, and when they drift the first lookup throwsMissingManifestResourceExceptionat run time rather than failing the build.That drift already happened once, in
examples/ImGuiAppDemo, and was fixed in08d9b60by pinning the name. Here the blast radius is larger: this resx holdsNerdFontandNotoEmoji, so a break lands on font and emoji loading in every consuming application.What changed
ImGui.App/ImGui.App.csproj— pins<LogicalName>ktsu.ImGui.App.Resources.Resources.resources</LogicalName>, the name the designer already looks up, with the same explanatory comment the demo carries.tests/ImGui.App.Tests/EmbeddedResourceManifestNameTests.cs— new. Rather than fixing this one file and leaving the class open (as the triage comment on the issue suggested checking), it walks every.resxin the repository and requires that each one:EmbeddedResourceitem carrying aLogicalName;LogicalNameequal to the name its sibling*.Designer.cspasses toResourceManager;plus two runtime assertions against the built library: the shipped assembly really embeds
ResourceManager.BaseName + ".resources", andNerdFont/NotoEmojiboth decode to non-empty fonts.The repository currently has exactly two
.resxfiles (this one and the demo's), so after this change the class is closed, and a third one added without a pin fails the test.Verification
The pinned value is what MSBuild already produced, so nothing about the built assembly changes today —
obj/**/ktsu.ImGui.App.Resources.Resources.resourcesis identical before and after, onnet8.0andnet10.0alike. The point is that a futureRootNamespacechange now fails a test instead of a consumer's font loading.EveryResxInTheRepository_PinsItsLogicalNamereportsImGui.App/Resources/Resources.resx has no LogicalName in ImGui.App.csproj) and pass with it — confirmed by reverting the one-line pin and re-running.tests/ImGui.App.Testssuite: 442/442 passing on Linux.dotnet build ImGui.App/ImGui.App.csproj -c Releaseclean acrossnet10.0;net9.0;net8.0, 0 warnings.🤖 Generated with Claude Code
https://claude.ai/code/session_01EGcveAXKn6XZnHU2G9jrro
Generated by Claude Code