dotnet / dotnet/dotnet-api-docs
DirectoryInfo.GetFiles() throws an undocumented UnauthorizedAccessException
Open
area-System.IO
Pri3
untriaged
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
```csharp
var dir = new DirectoryInfo(@"C:\Documents and Settings");
dir.GetFiles();
```
yields:
```
System.UnauthorizedAccessException: 'Access to the path 'C:\Documents and Settings' is denied.'
```
, which is [not documented](https://docs.microsoft.com/en-us/dotnet/api/system.io.directoryinfo.getfiles?view=netframework-4.0#System_IO_DirectoryInfo_GetFiles) for the empty method signature.
Contributor guide
Assessment
This issue has not been assessed yet.