I have a wcf service that is hosted on windows service and console host. and for some security reasons I'm using certificates.
certificate is installed on the client machine correctly. I use both console host (for Test) and windows service host. as I start my console host everything looks fine and my service works.
But, as I use windows service. when I want to start my service it poses an error and doesn't allow the service to run. the error is something that I already had fixed it. but, with no reason it has started to pop the same error.
Error message:
System.ArgumentException: It is likely that certificate 'CN=CertificateName' may not have a private key that is capable of key exchange or the process may not have access rights for the private key. Please see inner exception for detail. ---> System.Security.Cryptography.CryptographicException: Keyset does not exist
The thing is that this certificate works fine by console host application But, it its not working with windows service.
what should I do to use this certificate through windows service ?