I am trying to build a ClickOnce Windows Forms project (.NET 3.5 / Visual Studio 2010) on a Windows Server computer. (In an effort to automate the build process with Hudson
I had totally the same issue. And fixed it by installing Windows SDK 7.1 for .net 4.0 on the build machine. PS At first we've installed SDK 8.0A, and build was working fine except for singing. It seems, 7.1 updates some components in the system, so pfx begins to work.
Copy the PFX file over to the machine you are doing the builds on. Double-click on it, and install it in the certificate manager on the machine. Be sure you are logged into the account used to do the builds.
Other suggestions/questions: Do you have the right version of .NET installed on the machine? Do you have privileges to write to the certificate store on that machine?
If you open the Visual Studio project, go to the project properties and try to create a new certificate, does it work? It should create a PFX file and add it to the project. And can you see it in the certificate store (menu Start/certmgr.msc)?
I had same Problem, couldn't import on TFS machine. Turns out I had to export it on developer machine (project properties, signing page, click on more details) in more detail -> tab details and then just export with a password. Copy that exported file to TFS and use same password: done
I found that if you create a temporary.pfx file and leave the password EMPTY then it will work fine on the build machine. I didn't realize that you could leave it empty and the first time it failed as for OP. Created a second temp.pfx with no password and it built on the build server for me.