Andy Webster

Andy Webster

  • NA
  • 111
  • 0

System.UnauthorizedAccessException

Aug 13 2010 7:26 AM

Hi

Hoping someone can help as I am very confused!

I am writing an application to read some binary information from a file. I have access to the file without issue from windows explorer but when my application tries to open it a System.UnauthorizedAccessException is thrown.

I am using Windows 7 and so suspected UAC could be the issue. However even if I run my application as an administrator I get the same issue.

The account i am logged on with is an administrator and can open the file without issue. Also, when checking the file permissions of the file in question both my current account and the administrators group are denied nothing and granted 'Full Control'.

For the life of me I cannot figure out why the exception is thrown.

The code was created on VS C# Express 2010 and targets .Net 4. However, I do not believe I am using anything that would not compile on VS 2008 and .Net 2 

Anyone?

Thanks in advance for any light you may be able to shed on this issue.




Answers (1)