Build error when signing with snk key

末鹿安然 提交于 2019-12-05 04:46:39

I know it's been a while since this was asked but as I use SO for my own reference and I had this problem too I wanted to share my solution.

.snk files are for signing a project. You might need to make a new one.

  • Right click on your project, select properties.
  • Click on Signing.
  • Click the checkbox beside "Sign the assembly".
  • On the dropdown labelled "Choose a strong name key file" click new.
  • Fill in the dialog box as you wish noting particularly the Key file name. When you press ok, this will generate a new .snk file.
  • Save the project and rebuild.
  • This will use the new .snk in your project and will resolve the error.

Hope this helps.

Try to clean up the temp folder that is used by the build. I have seen different types of problems when the temp folder has lots of files.

Some of the tools are using GetTempFileName and they will get errors when temp has a lots of files

The GetTempFileName method will raise an IOException if it is used to create more than 65535 files without deleting previous temporary files.

This is probably an instance of this issue with Roslyn compiler. The workaround would be adding

<UseSharedCompilation>False</UseSharedCompilation>

under any <PropertyGroup> node in .csproj file.

It started for me when I moved the Resharper Cache to System Temp. When I moved it back to the Solution folder, the problem went away, and I could build again.

I just had the same problem. In Visual Studio 2015, I fixed it using the following steps:

  1. Go to Tools > Options
  2. From the Options dialog, select "Projects and Solutions > Build and Run"
  3. Set the "maximum number of parallel project builds" to 1

+1 to @stukselbax for getting me on the right track Also got help from this link

I used '/m:1' as an msbuild argument, and 'SignPublic' property to true in the csproj file.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!