One possible explanation may be that the process executing this code may not have permissions for this particular repository.
The Cert store really is a wrapper around a special part of the file system, and all certificates are really just files. They all have access control lists (ACLs), so if you do not have rights, you cannot see them.
You can easily check if this is your problem by running the code with the priviliges administrator (remember UAC, though).
Mark seemann
source share