Error MSB3321 with msbuild when using pfx

Hello,

I am building my first C# project using the MSBuild task and it keeps failing with the message

Target ReolveKeySource

ERROR MSB3321 in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1728,7) : L'importation du fichier de clé "SOAPMethod.pfx" a été annulée.

Sorry my OS is in French but basically it says that the import of the key file SOAPMethod.pfx was cancelled.

This file is the actual key file I use for string names in my C# project. Apparently it does not like when it has a password.

If I used an unsigned file (.snk file) then it works without issue.

 

I did what was suggested in post https://www.finalbuilder.com/Default.aspx?tabid=53&forumid=1&tpage=1&view=topic&postid=7070#7070 but it didn't changed anything.

 

Is there a way for me to specify the password anywhere, like in the Project properties to set of the task?

 

Thanks!

Daniel

Hi Daniel,

Unfortunately you can’t pass the key file’s password to MSBuild using project properties, the only solutions that I’m aware of is either the one you’ve already found on our forums, or the following suggested by a member of the MSBuild team (which would do pretty much the same thing as what the forum post describes):

http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/c9ae4963-a132-4759-b5b3-74ae0ba52945/

When you tried the solution on our forums, were you logged in as the same user when importing the certificate and running the build?

Regards,
Paul.

Hello,
Hum, that solution is not very practical, the whole point was to not have VS on the servers but only user MSBuild.

Apparently it works because I did install everything in a temporary VM to test and it worked fine after the first build where it asked the password.

Yes I did the procedure using the same user as the one building.

Thanks!