When I run my c# windows form app it response the follwing error
System.UnauthorizedAccessException: 'Access to the path 'C:\Users\My PC\Desktop\VERS backup\VERS\bin\Debug\Result.docx' is denied.'
When I run my c# windows form app it response the follwing error
System.UnauthorizedAccessException: 'Access to the path 'C:\Users\My PC\Desktop\VERS backup\VERS\bin\Debug\Result.docx' is denied.'
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Naimish MakwanaPosted Feb 13, 2023, 3:17 PM
Hello NURU,
Please check below things. Beacuse An
UnauthorizedAccessException'ssome possible reasons areThe file is being used by another process: The file you are trying to access may be open in another application or process, preventing access.
The caller does not have the required permission.
Anti-virus software: Anti-virus software can block the access to a file for security reasons.
Try to move your code from C: drive to some other drive.
Thanks
Naimish Makwana
Jignesh KumarPosted Feb 14, 2023, 4:57 AM
Hello Nuru,
User does not have permission. There are two solution for this one,
Rajat JaiswalPosted Feb 13, 2023, 3:08 PM
Hi,
You can choose a different path or give permission for the file .