I came across this error the other day after updating our ClickOnce manifest to be signed with a new digital certificate with a password. After searching google I discovered that this error was down to the fact that the user account that the automated build service was running under had never come across the certificate so msbuild was attempting to prompt the service with a password dialog box, needless to say this doesn’t end well and you get “The "ResolveKeySource" task failed unexpectedly”. The solution is to import the digital certificate into the personal store of the account the service is running under.
To do this follow these simple steps.
- Logon to the machine the automated build service is running on.
- Run the management console (start->run->mmc)
- Add the Certificates snap-in.
- Choose Service account, then Local computer.
- Now you should see a list of services pick the automated build service.
- Right click <ServiceName>\Personal choose All Tasks –> Import
- Navigate to the digital certificate.
- You must not enable strong private key protection.
- Finish the wizard.