Ensure that the assembly has a strong name
siimav opened this issue · comments
This step is necessary so that the library could be used in projects that require DLLs to be deployed to GAC.
Ref: https://learn.microsoft.com/en-us/dotnet/standard/assembly/sign-strong-name
- Strong naming is only used by framework, not more modern sdks such as net 5,6,7 and 8 (which do not have a GAC).
- It was controversal for framework because it imposes strict loading rules that may require binding redirects, and in turn the library developer is forced to not change assembly versions to avoid this.
- It also does not increase security in any way.
- If you are forced to use strong naming, there is an easy alternative. Add the nuget package StrongNamer (https://github.com/dsplaisted/strongnamer ). It contains an MSBuild task to add strong names to all unsigned assemblies. It will transparently strong name Holiday for you.
The GH doc does say the following:
Because of the viral nature of strong-naming, it is recommended that publicly published .NET libraries are strong-named.
In my experience most libraries published on Nuget do follow this. I see that there's not much point in arguing about this further though.
Btw, StrongNamer doesn't work with .net framework versions newer than 4.6.x
Indeed, my company uses a local fork of strongNamer updated to 4.8- using public PRs to the strongNamer repo. A pity there's no nuget.org package.