Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strong name the assemblies in this package #1467

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

AArnott
Copy link
Contributor

@AArnott AArnott commented Dec 26, 2024

Closes #520

Remaining issues

Strong naming requires that all referenced assemblies are also strong named. Failure to comply with this emits a warning from the C# compiler and an assembly load failure at runtime on .NET Framework.
This repo has references to a few assemblies that are not strong named. So to succeed at strong naming this repo, we must first get the upstream dependencies strong named:

  • CSC : warning CS8002: Referenced assembly 'EnumerableAsyncProcessor, Version=1.4.0.0, Culture=neutral, PublicKeyToken=null' does not have a strong name.
  • CSC : warning CS8002: Referenced assembly 'Sourcy.Core, Version=0.0.66.0, Culture=neutral, PublicKeyToken=null' does not have a strong name.
  • CSC : warning CS8002: Referenced assembly 'trxparser, Version=0.5.0.0, Culture=neutral, PublicKeyToken=null' does not have a strong name.

While some of these are only dependencies of tests, and the tests would not strictly need to be strong named for your users, your repo uses InternalsVisibleTo, and a strong named assembly is only allowed to use InternalsVisibleTo to other strong named assemblies. So if you expose internals to your tests, you have to strong name them too.
I haven't closely researched to see if we can weed out any of the above dependencies from what must change in order for this change to be successful. I'll do a bit more research later today.

@thomhurst
Copy link
Owner

Sourcy and EnumerableAsyncProcessor are my libraries too so I can easily accept a pr to strong sign them and push out a new version of each. Trxparser isn't mine though.

This reduces the dependencies we need to get strong name signed down to just `EnumerableAsyncProcessor`.
Fortunately, no one in this repo uses InternalsVisibleTo to this project, or it would _have_ to be strong named.
This avoids warnings about non-strong named TUnit assemblies that come from previously published nuget packages.
Once strong named assemblies are published to nuget.org and that newer version is consumed in this cycle, we *can* start strong naming this project if desired.
@AArnott
Copy link
Contributor Author

AArnott commented Dec 26, 2024

I was able to filter the problem to just EnumerableAsyncProcessor, which thomhurst/EnumerableAsyncProcessor#134 will solve when merged and published.

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.

Strong Naming - Sign assembly with a key
2 participants