Skip to content

Fix strong name signing: remove OS-conditional PublicSign#480

Merged
wieslawsoltes merged 1 commit into
wieslawsoltes:masterfrom
cms-xiao:fix/strong-name-signing
Apr 7, 2026
Merged

Fix strong name signing: remove OS-conditional PublicSign#480
wieslawsoltes merged 1 commit into
wieslawsoltes:masterfrom
cms-xiao:fix/strong-name-signing

Conversation

@cms-xiao
Copy link
Copy Markdown
Contributor

Summary

Removes the OS-conditional PublicSign from build/SignAssembly.props to fix strong name validation failures on .NET Framework 4.x.

Problem

Since v3.3.0, when the CI was moved from Azure Pipelines (windows-2022) to GitHub Actions (ubuntu-latest), the PublicSign condition in SignAssembly.props activates on Linux:

<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>

This causes the net461 assemblies (ShimSkiaSharp, Svg.Custom, Svg.Model, Svg.Skia) to be public-signed only — no real RSA signature is produced. .NET Core/5+ ignores this since it skips strong name verification entirely, but .NET Framework 4.x enforces verification and throws FileLoadException at runtime:

Could not load file or assembly 'ShimSkiaSharp, Version=3.7.0.0, Culture=neutral,
PublicKeyToken=dafe96fe6c845a74'. Strong name signature could not be verified.

Verified with sn.exe -vf: all versions from 3.3.0 through 4.0.0-rc1 fail; 3.2.1 and earlier pass.

Fix

Remove the <PublicSign> line. Since svg.skia.public.snk contains a full 596-byte RSA key pair (not just the public key), the .NET SDK can produce real signatures on all platforms — Windows, Linux, and macOS — without needing PublicSign.

Fixes #479

…T Framework

The PublicSign condition `'$(OS)' != 'Windows_NT'` causes assemblies built
on Linux (GitHub Actions CI) to be public-signed only, without a real RSA
signature. This breaks strong name verification on .NET Framework 4.x,
which unlike .NET Core/5+ enforces signature validation at runtime.

Since svg.skia.public.snk contains a full RSA key pair (596 bytes), real
signing works on all platforms with modern .NET SDK without needing
PublicSign.

Fixes wieslawsoltes#479

Made-with: Cursor
@wieslawsoltes
Copy link
Copy Markdown
Owner

@codex full review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Strong name validation fails on .NET Framework since v3.3.0 (public signing on Linux CI)

2 participants