Installing p12 certificate under Local System Account (Windows Server 2008)

I'm running TeamCity 5.1 on a Windows 2008 server. TeamCity runs under the Local System Account (LSA) per default.

I checkout a Visual Studio 2010 project that contain a p12 certificat. I build the project using the solution file (sln).

The build fails with the following error message:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1970, 9): error MSB3326: Cannot import the following key file: . The key file may be password protected. To correct this, try to import the certificate again or import the certificate manually into the current user’s personal certificate store.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1970, 9): error MSB3321: Importing key file "cert.p12" was canceled.

So I use the Certificates.msc to import the certificate into the Personal section of Certificates - Service (TeamCity Build Agent Service) on Local Computer under TCBuildAgent\Personal\Certificates.


That does not resolve the issue.


So (in irritated frenzy) I install the certificates in every store i can find, but nothing (positive) happens.

I then try installing the certificate under LSA using the tool PsExec, but nothing is resolved.


So what am I doing wrong? Obviously I cannot brute force solve this one Any help is much appreciated!

3 comments

Please try do the following:
- make build agent service running under some existing administrative account
- log in to this account and check the is running from commandline
- install sertificate there if required
- try again

Does it help?

0

I was having the same issue and these steps solved it.

0

I am running into the same issue

  • ResolveKeySource        
  • ResolveKeySource        
  • C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2455, 5): error MSB3325: Cannot import the following key file: Luminator.WMATA.Silverlight_TemporaryKey.pfx. The key file may be password protected. To correct this, try to import the certificate again or manually install the certificate to the Strong Name CSP with the following key container name: VS_KEY_99D3ED7F4AA24281        
  • C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2455, 5): error MSB3321: Importing key file "Luminator.WMATA.Silverlight_TemporaryKey.pfx" was canceled.        
  • Project trunk\Source\Projects\Luminator.WMATA.Silverlight\Luminator.WMATA.Silverlight.csproj failed.


See below:


Please try do the following:
- make build agent service running under some existing administrative account
Nat>> It is running under admin account. When I open the solution in VS2012 on the build machine and build it builds fine.
- log in to this account and check the is running from commandline
Nat>> Did not follow this step ..can you explain?
- install sertificate there if required
Nat>> Install where?
- try again

Does it help?

0

Please sign in to leave a comment.