According to MSDN , UnauthorizedAccessExceptionit can also be called:
path specified a file that is read-only.
-or-
This operation is not supported on the current platform.
-or-
path specified a directory.
Is it possible that one of these conditions is causing your problem?
source
share