12
いAspのネットMVC4アプリケーションでX509Certificate2UIクラスを使って誰でも持っていた問題名「X509Certificate2UIは、」現在のコンテキスト内に存在しない
それは現在のコンテキスト には「X509Certificate2UI」名前がありませんがないと文句を言いusing System.Security.Cryptography.X509Certificates;
private static X509Certificate2 PickCertificate(StoreLocation location, StoreName name)
{
try
{
store.Open(OpenFlags.ReadOnly);
//PROBLEM IS HERE
X509Certificate2 cert = X509Certificate2UI.SelectFromCollection(store.Certificates, "Caption", "Message", X509SelectionFlag.SingleSelection)[0];
}
catch (Exception)
{
throw;
}
}
アイデアはクラスがSystem.Security.Cryptography.X509Certificatesにあるためです。
私の最初の答えを編集しました。質問をはっきりと読まなかった。 :( – freshbm
これは早い段階で、テストしてうまくいくことがわかった。参考:http://www.pcreview.co.uk/forums/missing-x509certificate2ui-class-t2311992.html –