This sounds like the old issue of signtool, the program that actually does the signing, not having permissions to access the location where the key, that is used for signing, is stored.
To test this, restart VS as an admin and then try it again.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
When I am trying to sign the Assembly, I am getting below error. I am using Visual Studio Enterprise 2022 and framework 4.6.2. I tried using latest framework as well.
This sounds like the old issue of signtool, the program that actually does the signing, not having permissions to access the location where the key, that is used for signing, is stored.
To test this, restart VS as an admin and then try it again.
Thank you for reaching out. Please find the answer below.
Run Visual Studio as Administrator
signtool.exe
) elevated permissions it may need. Check Permissions on Key File Location
Try Signing with a New Key
Verify Assembly Location:
.pfx
certificate or a strong name key file (.snk
)?sn.exe
or signtool.exe
from the Developer Command Prompt with elevated permissions.Ensure that your project is configured correctly for assembly signing, and verify you have the necessary permissions to access the key. Also, try updating Visual Studio and the .NET Framework to the latest versions.