[GH-ISSUE #43] Access to the path '' is denied. #38

Closed
opened 2026-02-25 21:30:31 +03:00 by kerem · 15 comments
Owner

Originally created by @scottydel on GitHub (Jan 17, 2018).
Original GitHub issue: https://github.com/brutaldev/StrongNameSigner/issues/43

I installed the GUI version and run into this error every time. I have a couple unsigned DLLs in a local folder I created on my machine. I verified my AD account has rights to this folder, as well as the DLLs. When ever I add the files, and click "Sign Assemblies" the output log says: "Error strong-name signing : Access to the path '' is denied." Tried rebooting. Tried moving them to a different folder. Not sure what's going on.

Originally created by @scottydel on GitHub (Jan 17, 2018). Original GitHub issue: https://github.com/brutaldev/StrongNameSigner/issues/43 I installed the GUI version and run into this error every time. I have a couple unsigned DLLs in a local folder I created on my machine. I verified my AD account has rights to this folder, as well as the DLLs. When ever I add the files, and click "Sign Assemblies" the output log says: "Error strong-name signing <my path>: Access to the path '<my path>' is denied." Tried rebooting. Tried moving them to a different folder. Not sure what's going on.
kerem closed this issue 2026-02-25 21:30:31 +03:00
Author
Owner

@brutaldev commented on GitHub (Jan 17, 2018):

Have you tried running with elevated privileges (right-click -> Run as Administrator)?

<!-- gh-comment-id:358429818 --> @brutaldev commented on GitHub (Jan 17, 2018): Have you tried running with elevated privileges (right-click -> Run as Administrator)?
Author
Owner

@scottydel commented on GitHub (Jan 17, 2018):

I have tried that yes. It creates the *.unsigned file. The first time I run the error message says no access to the original DLL. The next time I run the error message says no access to the *unsigned file it previously created.

<!-- gh-comment-id:358431179 --> @scottydel commented on GitHub (Jan 17, 2018): I have tried that yes. It creates the *.unsigned file. The first time I run the error message says no access to the original DLL. The next time I run the error message says no access to the *unsigned file it previously created.
Author
Owner

@brutaldev commented on GitHub (Jan 17, 2018):

Any other process locking the file up? When you get access denied errors it's not always permissions but quite often other processes using the files that prevents you from making changes to it while a file lock is in place. Use LockHunter or something similar to try and determine what is using the file access.

What version are you using?

<!-- gh-comment-id:358432007 --> @brutaldev commented on GitHub (Jan 17, 2018): Any other process locking the file up? When you get access denied errors it's not always permissions but quite often other processes using the files that prevents you from making changes to it while a file lock is in place. Use [LockHunter](https://lockhunter.com/) or something similar to try and determine what is using the file access. What version are you using?
Author
Owner

@scottydel commented on GitHub (Jan 17, 2018):

Ok thanks, I will try lockhunter and see if something is holding it up. I"m using 2.1.3.0.

<!-- gh-comment-id:358432385 --> @scottydel commented on GitHub (Jan 17, 2018): Ok thanks, I will try lockhunter and see if something is holding it up. I"m using 2.1.3.0.
Author
Owner

@scottydel commented on GitHub (Jan 17, 2018):

Lockhunter shows no process are locking any of the files (4 in total, two original DLLs and two *.unsigned files created by Strong-Name Signer).

<!-- gh-comment-id:358433367 --> @scottydel commented on GitHub (Jan 17, 2018): Lockhunter shows no process are locking any of the files (4 in total, two original DLLs and two *.unsigned files created by Strong-Name Signer).
Author
Owner

@brutaldev commented on GitHub (Jan 17, 2018):

Not sure what to tell you. The lock might come and go during the process, like an anti-virus accessing the file to perform a scan just at the point it's trying to write to it again. Not much we can do about this since it's incredibly environment specific and no-one else has reported any issues with locking during the signing process.

<!-- gh-comment-id:358433909 --> @brutaldev commented on GitHub (Jan 17, 2018): Not sure what to tell you. The lock might come and go during the process, like an anti-virus accessing the file to perform a scan just at the point it's trying to write to it again. Not much we can do about this since it's incredibly environment specific and no-one else has reported any issues with locking during the signing process.
Author
Owner

@scottydel commented on GitHub (Jan 17, 2018):

That is a great point. I'm using my work development machine, and our network can be very locked down (big company = big brother). I will try this again on my home development machine. Thank you for taking the time to respond. I will report back what I find and hopefully figure it out.

<!-- gh-comment-id:358434430 --> @scottydel commented on GitHub (Jan 17, 2018): That is a great point. I'm using my work development machine, and our network can be very locked down (big company = big brother). I will try this again on my home development machine. Thank you for taking the time to respond. I will report back what I find and hopefully figure it out.
Author
Owner

@scottydel commented on GitHub (Jan 18, 2018):

I tried at home and surprisingly same results. So something must be up with these particular DLLs I'm trying to sign? I checked permissions (at home) and I have full access to the folder and files. FWIW, I'm leaving the three text boxes above blank. I'll keep playing around. Again thank you for taking the time to help 👍

<!-- gh-comment-id:358647691 --> @scottydel commented on GitHub (Jan 18, 2018): I tried at home and surprisingly same results. So something must be up with these particular DLLs I'm trying to sign? I checked permissions (at home) and I have full access to the folder and files. FWIW, I'm leaving the three text boxes above blank. I'll keep playing around. Again thank you for taking the time to help 👍
Author
Owner

@scottydel commented on GitHub (Jan 18, 2018):

I played around at home, and selected a DLL from an old project and the tool worked perfectly. So the two DLLs I am working with are the issue. One of these DLLs is home grown in Visual Studio 2017, and the other is a third party DLL, Renci.SshNet.dll (which is referenced by the home grown DLL). Any ideas if there is something I am doing in VS 2017 that could be preventing the tool from working?

I tried signing them by hand originally, but this is the error I get when running code:

Message :[C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Renci.SshNet\v4.0_2013.4.7.0__e10d9eb3a09c3cf6\Renci.SshNet.dll] Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

What brought me to your tool was that it sets InternalsVisibleTo. The 3rd party DLL, Renci.SshNet.dll, is the one that needs this attribute added I believe, and since it's 3rd party I don't have the source code to rebuild the DLL

<!-- gh-comment-id:358650416 --> @scottydel commented on GitHub (Jan 18, 2018): I played around at home, and selected a DLL from an old project and the tool worked perfectly. So the two DLLs I am working with are the issue. One of these DLLs is home grown in Visual Studio 2017, and the other is a third party DLL, Renci.SshNet.dll (which is referenced by the home grown DLL). Any ideas if there is something I am doing in VS 2017 that could be preventing the tool from working? I tried signing them by hand originally, but this is the error I get when running code: Message :[C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Renci.SshNet\v4.0_2013.4.7.0__e10d9eb3a09c3cf6\Renci.SshNet.dll] Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.<br/> What brought me to your tool was that it sets InternalsVisibleTo. The 3rd party DLL, Renci.SshNet.dll, is the one that needs this attribute added I believe, and since it's 3rd party I don't have the source code to rebuild the DLL
Author
Owner

@brutaldev commented on GitHub (Jan 18, 2018):

The SSH.NET library is actually open source so you could compile it and apply a strong name key at that point. Which built version are you using, and does it sign on it's own if it's the only file you use? I'd like to get a copy of the same file you are using to debug with, if it's the .NET Core version then the strong-name signer won't be able to sign it: https://github.com/brutaldev/StrongNameSigner/issues/41

<!-- gh-comment-id:358661970 --> @brutaldev commented on GitHub (Jan 18, 2018): The SSH.NET library is actually [open source](https://github.com/sshnet/SSH.NET) so you could compile it and apply a strong name key at that point. Which built version are you using, and does it sign on it's own if it's the only file you use? I'd like to get a copy of the same file you are using to debug with, if it's the .NET Core version then the strong-name signer won't be able to sign it: https://github.com/brutaldev/StrongNameSigner/issues/41
Author
Owner

@brutaldev commented on GitHub (Jan 18, 2018):

Hmm, if I get the latest version and drop it into the UI, it's already signed so the tool won't do anything to it.

<!-- gh-comment-id:358662937 --> @brutaldev commented on GitHub (Jan 18, 2018): Hmm, if I get the [latest version](https://github.com/sshnet/SSH.NET/releases/tag/2016.1.0) and drop it into the UI, it's already signed so the tool won't do anything to it.
Author
Owner

@scottydel commented on GitHub (Jan 18, 2018):

SSH.NET 2013.4.7, I think it's older. Our home grown app that I'm working on is older. With just the Renci.SshNet.dll file in the UI, same result, access denied. I will try and compile SSH.NET with our dll listed as a friendly and see if that fixes it. I'm able to add Renci.SshNet.dll as a friendly to our app, but I think it needs to be the other way around.

<!-- gh-comment-id:358664755 --> @scottydel commented on GitHub (Jan 18, 2018): SSH.NET 2013.4.7, I think it's older. Our home grown app that I'm working on is older. With just the Renci.SshNet.dll file in the UI, same result, access denied. I will try and compile SSH.NET with our dll listed as a friendly and see if that fixes it. I'm able to add Renci.SshNet.dll as a friendly to our app, but I think it needs to be the other way around.
Author
Owner

@brutaldev commented on GitHub (Jan 18, 2018):

Alright, figured out what the issue is. Your files have the Read-only attribute set so when trying to overwrite them you get the access denied error. This breaks on the unsigned backup files too because they are just copies of the original and carry the flag with them.

Right click -> Properties on your file and uncheck the Read-only check box and all should be fine.

I'm making an update to reset the flag on the files before processing them so you will not have to uncheck it manually in future.

<!-- gh-comment-id:358748732 --> @brutaldev commented on GitHub (Jan 18, 2018): Alright, figured out what the issue is. Your files have the **Read-only** attribute set so when trying to overwrite them you get the access denied error. This breaks on the unsigned backup files too because they are just copies of the original and carry the flag with them. _Right click -> Properties_ on your file and uncheck the **Read-only** check box and all should be fine. I'm making an update to reset the flag on the files before processing them so you will not have to uncheck it manually in future.
Author
Owner

@brutaldev commented on GitHub (Jan 18, 2018):

Fixed in release 2.1.4

<!-- gh-comment-id:358772955 --> @brutaldev commented on GitHub (Jan 18, 2018): Fixed in release [2.1.4](https://github.com/brutaldev/StrongNameSigner/releases/tag/v2.1.4)
Author
Owner

@scottydel commented on GitHub (Jan 19, 2018):

Thank you and nice catch. I will grab the new version and continue. Much appreciated!!!

<!-- gh-comment-id:358836067 --> @scottydel commented on GitHub (Jan 19, 2018): Thank you and nice catch. I will grab the new version and continue. Much appreciated!!!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/StrongNameSigner#38
No description provided.