visual studio 2017 build dll sign the assembly error

Category: visual studio general

Question

Genghis2011 on Mon, 23 Apr 2018 21:08:53


I have a C# visual studio project which I had built the dll from it without any issue for a few years. The dll is built with “Sign the assembly” box checked.

Now I am not able to build the dll any more, it always gives the error: Error  CS7027  Error signing output with public key from file '..\..\samplekey.snk' -- The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)

Nothing had been changed since I built the dll successfully last time. I uses Windows 10 and Visual studio 17 version 15.4.1

I tried with creating Strong Name Key option from visual studio to use a new key file, it gives the same error message. I couldn't found any process which uses the .snk file. I also restarted windows, it didn't solve the issue. 

Does anyone have idea or recommendation? Any helps are appreciated.

Replies

Fletch Zhou on Tue, 24 Apr 2018 06:13:50


Please try to generate a new .snk file and see.

 

Regards,

Fletcher


MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


Genghis2011 on Tue, 24 Apr 2018 14:42:59


@FLetcher, I tried with generating a new .snk file, it didn't work. It gave the same error message for the new generated .snk file. 

Fletch Zhou on Wed, 25 Apr 2018 09:04:03


Would you mind installing the latest update of VS2017 which is 15.6.6 now and see.

 

Regards,

Fletcher


MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


Genghis2011 on Fri, 27 Apr 2018 20:08:23


I upgraded VS2017 to latest version 15.6.7.
I tried with generating a new .snk file. It still gave the same error message.

Jack Zhai-MSFT on Mon, 30 Apr 2018 07:55:40


Hi Genghis2011,

How about the result if you move the cache or temp folder in your side?

Best Regards,

Jack