I have in my dev machine a WCF Client which requires certificate and it is working fine.
After the deployment to production server I get the following Error:
Try this:
new X509Certificate2(Path, "", X509KeyStorageFlags.MachineKeySet);
It appears that the X509Certificate2 constructor tries to access the private key store of the local user (even when loading a PFX and the private key is in the PFX). With asp.net, the user profile typically isn't loaded, so the user key store doesn't exist. Specifying MachineKeySet tells the constructor to look at the Local Computer key store which always exists.