I am trying to give a strong name to a .NET Core assembly in Visual Studio 2022 (using the standard instructions (https://learn.microsoft.com/en-us/dotnet/standard/assembly/sign-strong-name)
I have created a .snk
file using command sn -k mykey.snk
. In the properties of my project under "Strong Naming", I checked "Sign the assembly" and chose the mykey.snk
file.
After building the project to MyLib.dll
, I wanted to check that it has a strong name, but running command sn -tp MyLib.dll
shows the following message:
Failed to convert key to token -- Invalid assembly public key.
I tried the same flow on assembly in .NET Core 6, 7 and 2.1 - same result.
Is it a bug, or did I miss something? What is the correct way to give a strong name to .NET Core assembly?