I encounter a little problem with a WPF application. I have a certificate in my store that contains a private key, private key that I'm using to sign XML for a webRequest. This is coded in a different assembly than my WPF application.
When I launch my tests in an admin Visual Studio, I can access private key member of X509Certificate2.
When I launch my tests in a non admin Visual Studio, I can access private key member of X509Certificate2 too.
Everything works fine in VsTestEngine.
But, when I launch my WPF in debug in an admin Visual Studio or not, I cannot access my private key (CryptographicException, keyset is not defined) ? I tried to launch my WPF debug exe in admin mode without Visual Studio, and same result...
Is there a specific option in debugging or in app.config to set to access certificate store ?
Environment : Visual studio 2013, .NET 3.5 (tried with 4.0, 4.5 and 4.5.2), Windows 8.1 pro
Thanks for answers.