Skip to content

Fully sign the StrongName assemblies on every platform - #2237

Merged
mgravell merged 1 commit into
mainfrom
fix-strongname-signing
Sep 22, 2026
Merged

mgravell merged 1 commit into
mainfrom
fix-strongname-signing

Conversation

@mgravell

Copy link
Copy Markdown
Member

Dapper.StrongName and Dapper.EntityFramework.StrongName 2.1.86 fail strong-name
validation on .NET Framework
: they shipped with an all-zero signature blob.

Evidence

Signature blob of the shipped Dapper.StrongName assemblies:

Version Blob Non-zero bytes
2.1.79 128B 127 real signature
2.1.86 128B 0 public-signed only

Same for Dapper.EntityFramework.StrongName. Dapper and the other packages are not
strong-named and are unaffected.

Cause

Both projects carried:

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

Public signing stamps the public key and sets the STRONGNAMESIGNED flag but writes no
actual signature — the assembly claims to be strong-named and isn't. .NET Core and later
don't verify strong names, so only .NET Framework consumers hit it.

The condition never fired before because nuget.org releases were packed by hand on Windows.
release.yml (added in #2230) builds on ubuntu-latest, so it now fires on every release.
This is a regression introduced by #2230.

Fix

Remove the condition so every platform fully signs. That PublicSign dance is a legacy
workaround from when Roslyn couldn't fully sign off Windows — it can now. Fixing the cause
beats moving the release job to Windows to avoid it, and it keeps Linux developer builds
honest as well.

Verified locally: a full dotnet pack Build.csproj on Linux produces real 128-byte
signatures for every TFM of both packages.

Dapper.snk is unchanged — untouched since the commit that introduced Dapper.StrongName
so the public key token is identical. This is a signature fix, not an identity change, and
Windows builds are unaffected (the condition was already false there).

After merging

Release 2.1.87, then unlist the two broken 2.1.86 StrongName packages on nuget.org.

2.1.86 shipped Dapper.StrongName and Dapper.EntityFramework.StrongName with an
all-zero strong-name signature, so they fail strong-name validation when loaded
on .NET Framework. Comparing the shipped assemblies:

  2.1.79  sig 128B, nonzero=127  real signature
  2.1.86  sig 128B, nonzero=0    public-signed only

Both projects carried

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

Public signing stamps the public key and sets the STRONGNAMESIGNED flag but
writes no actual signature: the assembly claims to be strong-named and is not.
.NET Core and later do not verify strong names, so only .NET Framework consumers
see the failure.

The condition never fired in practice because releases were packed by hand on
Windows. release.yml now builds on ubuntu-latest, so it fires on every release -
this is a regression introduced by #2230, not by anything in the signing setup.

The condition is a legacy workaround from when Roslyn could not fully sign off
Windows; it can now. Removing it rather than moving the release job to Windows
fixes the cause instead of avoiding it, and keeps a Linux developer build honest
too. Verified on Linux: a full Build.csproj pack produces real 128-byte
signatures for every TFM of both packages.

Dapper.snk is unchanged - untouched since the commit that added Dapper.StrongName
- so the public key token is identical and this is a signature fix, not an
identity change. Windows builds are unaffected: the condition was already false
there.
@mgravell
mgravell merged commit 8baab07 into main Sep 22, 2026
2 checks passed
This was referenced Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant