JcBernack / WinBioNET

Managed wrapper in C#/NET for the Windows Biometric Framework
MIT License
58 stars 14 forks source link

Adding database and restarting biometric service #1

Closed schtritoff closed 8 years ago

schtritoff commented 8 years ago

First, thanks for putting this lib in the public domain.

There is an issue with WBF that when you try to add database, it won't actually get created until windows biometric service is restarted. Some dirty workarround is to restart biometric service (see https://social.msdn.microsoft.com/Forums/vstudio/en-US/ea69bb0e-e534-4873-8c5f-5476b554ca28/winbio-private-pool-opensession?forum=windowssecurity), maybe there is some better way to do this. Admin right are required for all this.

Also, if you add database and then try to remove it without restarting biometric service, it will fail when trying to delete database file beacuse there is no file at given path (at RemoveDatabase, File.Delete(database.FilePath);)

JcBernack commented 8 years ago

Thanks for reporting the issue.

The second part should not really be a problem since File.Delete() does not throw an exception if the file to be deleted does not exist.

schtritoff commented 8 years ago

About the second part, it didn't work for me because Exception was thrown and database was not deleted from registry. I had to put that code into try catch block to delete database successfully. Example: untitled

JcBernack commented 8 years ago

Did you check what type of exception is thrown?