2
votes

I am building a WCF service as in this article and facing trouble with X.509 certificate.

When I debug, everything is OK. When I publish and run the application, I receive the error:

Cannot find the X.509 certificate using the following search criteria: StoreName 'My', StoreLocation 'CurrentUser', FindType 'FindBySubjectName', FindValue 'WCFServer'.

What troubleshooting steps can I take?

The server is IIS 5.1 on Windows XP SP3

2
@Tran: please don't put tags like "WCF" in the title. Leave them in the tags.John Saunders
ần: did you import your .pfx into the "Computer account"? Are you loading the certificate in code at runtime?p.campbell

2 Answers

1
votes

At a guess: it seems to be looking in the "CurrentUser" store, which is tied to your user account. Your IIS instance might not be running under that user account, in which case it won't find the cert. You'd need to use the global store, or to install the cert under your IIS service user's account to fix the problem.

0
votes

When you publish your service is it running on the same development machine? If not make sure you install the cert in the store on the machine you are publishing to.