title: CryptographicException was unhandled: System cannot find the specified file
body: <p>I am trying to embrace the mysteries of SSL communication and have found a great tutorial on <a href="http://www.codeproject.com/Articles/326574/An-Introduction-to-Mutual-SSL-Authentication" rel="noreferrer">this site</a>. I was trying to test my own certificate. Using Visual Studio 2012, I simply added an existing file (my certificate in .pfx format) and then changed the "certificate" and "password" settings in app.config. However, when trying to run it, I got an error:</p>
  
  <blockquote>
    <p>CryptographicException was unhandled: System cannot find the specified file</p>
  </blockquote>
  
  <p>Then, I tried the same in my Web Service. There I got some more details about the error:</p>
  
  <pre><code>System.Security.Cryptography.CryptographicException: System cannot find specified file.
  
     at System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr)
     at System.Security.Cryptography.X509Certificates.X509Utils._QueryCertFileType(String fileName)
     at System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromFile(String fileName, Object password, X509KeyStorageFlags keyStorageFlags)
     v System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(String fileName, String password)
     v TestServer.DataService.LoadSoap() v c:\Users\Administrator\Documents\Visual Studio 2012\Projects\TestServer\TestServer\DataService.asmx.cs:line 48
  </code></pre>
  
  <p>I have written this question to the author of the article, but since his last reply was in March 2012, I am not sure, whether he will reply. If somebody could help me with this problem, I would be very grateful.</p>
  
  <p>P.S.: When exporting the certificate from .cer to .pfx, I have changed the title of the file exported. Although I doubt its effect on the problem, I'd rather mention it.</p>