I have an ASP.NET MVC4 application and I use the following code to read the user's A3 (reader or pendrive) certificate:
var store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
store.Open(OpenFlags.OpenExistingOnly | OpenFlags.MaxAllowed);
var collection = store.Certificates;
var fcollection = collection.Find(X509FindType.FindByTimeValid, DateTime.Now, true);
var scollection = X509Certificate2UI.SelectFromCollection(fcollection, "Certificados válidos:", "Selecione o certificado que deseja usar",
X509SelectionFlag.SingleSelection);
As I'm debugging (using IISExpress) the code works fine, but when I publish the application to IIS 7.5 (on my local machine) it returns the following error:
The current session is not interactive.
Question: Is it possible for IIS to "respect" the above code in the same way IISExpress does?