Я создаю службу не в первый раз, и она запускается регулярно, но не работает. открыл хранилище сертификатов и не понимаю почему.
Я не получаю никаких сообщений об ошибках, оно просто не открывается
Это код, который не работает:
Код: Выделить всё
string[] aFiles = Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory, "*.pdf");
if (aFiles.Length > 0)
{
tSign.Stop();
//Up to this point everything is fine, because it finds the pdf file, but then the store doesn't open
X509Store x509Store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
X509Certificate2 certSelected = null;
x509Store.Open(OpenFlags.ReadOnly);
//Maybe it's an asynchronous call and I don't see it?
tSign.Start();
}
РЕДАКТИРОВАНИЕ: это форма выбора сертификата:
[img]https://i.sstatic.net /TpxQkMAJ.png[/img]
Подробнее здесь: https://stackoverflow.com/questions/786 ... -a-service
Мобильная версия