Skip to content

Strong name the assemblies - #293

Open
eXpl0it3r wants to merge 1 commit into
masterfrom
feature/strong-naming
Open

eXpl0it3r wants to merge 1 commit into
masterfrom
feature/strong-naming

Conversation

@eXpl0it3r

Copy link
Copy Markdown
Collaborator

Description

A strong-named .NET Framework assembly can only reference strong-named assemblies, so anyone with a strong-named app on .NET Framework currently can't use HTML Renderer at all. On .NET Core and .NET 5+ the runtime ignores strong names, so there it changes nothing.

All assemblies are now signed with Source/HtmlRenderer.snk, public key token 8ad04eaa796bce90. The key is committed on purpose, strong names aren't a security feature and Microsoft's guidance for open source libraries is to keep the key in the repo, same as HtmlKit and PDFsharp do. Additionally:

  • PublicKey is set in Directory.Build.props, so the existing InternalsVisibleTo items get the key without listing it each time
  • The test projects are signed as well, they need it to see the internals
  • The demos are signed, because the tests reference Demo.Common

Note that a strong name changes the assembly identity, so this is a breaking change and belongs into 2.0. Going forward, AssemblyVersion has to stay at 2.0.0.0 for all of 2.x, any change of it breaks the binding of strong-named references on .NET Framework. The NuGet version and FileVersion can change freely.

Closes #292

How to test this PR?

CI should succeed. [AssemblyName]::GetAssemblyName("HtmlRenderer.dll").FullName should end with PublicKeyToken=8ad04eaa796bce90.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Strong naming

1 participant