Reputation: 638
Build error is occurring since using Visual Studio 2015. When building in Visual Studio 2015 this is occurring rarely. When building in TeamCity this occurs very often.
[Error in Visual Studio 2015]
https://i.sstatic.net/hKbbe.png
[Error in TeamCity]
https://i.sstatic.net/rbgHx.png
Upvotes: 12
Views: 26670
Reputation: 1
I am building an open source project with Visual Studio 2022. The open source project was throwing this error. I do not need to sign the project to do my testing.
In Visual Studio 2022, right-click on the project. Left-click Properties. Scroll down to Build / Strong Naming. Under Sign the assembly, uncheck Sign the output assembly to give it a strong name.
Build the project and the error no longer displays.
Upvotes: 0
Reputation: 173
double click on your project and set to false:
<SignAssembly>false</SignAssembly>
<PublicSign>false</PublicSign>
remove this line :
<AssemblyOriginatorKeyFile>CompanyName.snkk</AssemblyOriginatorKeyFile>
Upvotes: 1
Reputation: 21
Just had this issue today in visual Studio 2022- I was messing with the csproj file and ended up having the wrong filepath to the snk file. I fixed it by changing the filepath to be correct.
Right-click on the project -> unload (so that you can edit the csproj file)
Under <PropertyGroup>
check the <AssemblyOriginatorKeyFile>
tag
My code was:<SignAssembly>true</SignAssembly> <AssemblyOriginatorKeyFile>../NAMEHERE.snk</AssemblyOriginatorKeyFile>
NAMEHERE was specific to my project, yours will vary. Look at your snk file. The ../ in front will vary, check the filepath of your snk file. If you caused this error by messing with your csproj file, like I did, then the correct answer is what the filepath was before you changed it. :)
Right-click on the project -> reload
Upvotes: 0
Reputation: 31
I used '/m:1' as an msbuild argument, and 'SignPublic' property to true in the csproj file.
Upvotes: 0
Reputation: 12630
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.
Upvotes: 2
Reputation: 4675
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.
Hope this helps.
Upvotes: 14
Reputation: 384
I just had the same problem. In Visual Studio 2015, I fixed it using the following steps:
+1 to @stukselbax for getting me on the right track Also got help from this link
Upvotes: 0
Reputation: 1894
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.
Upvotes: 0
Reputation: 8807
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.
Upvotes: 4