Fully sign the StrongName assemblies on every platform (#2237)

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.
This commit is contained in:
Marc Gravell
2026-09-22 22:46:01 +01:00
committed by GitHub
parent 8becae8d0e
commit 8baab07773
2 changed files with 0 additions and 2 deletions
@@ -7,7 +7,6 @@
<TargetFrameworks>net461</TargetFrameworks>
<AssemblyOriginatorKeyFile>../Dapper.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<PackageId>Dapper.EntityFramework.StrongName</PackageId>
<PackageTags>orm;sql;micro-orm</PackageTags>
<Nullable>enable</Nullable>
@@ -7,7 +7,6 @@
<Authors>Sam Saffron;Marc Gravell;Nick Craver</Authors>
<TargetFrameworks>net461;netstandard2.0;net8.0;net10.0</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants>$(DefineConstants);STRONG_NAME</DefineConstants>