dotnet / dotnet/dotnet-api-docs
FileSystemSecurity.xml: The example doesn't compile, contains non-existent method, no typos
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
Hello
I'm reporting a faulty example code in the [FileSystemSecurity Class](https://learn.microsoft.com/en-us/dotnet/api/system.security.accesscontrol.filesystemsecurity?view=net-7.0&source=docs) page for .NET 7.0 (and potentially other versions). The associated source page is [FileSystemSecurity.xml](https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Security.AccessControl/FileSystemSecurity.xml)
The code doesn't compile (generating four CS0117 errors) because it calls two non-existent methods: `File.GetAccessControl()` and `File.SetAccessControl()`.
- In the C# version, the bad calls are on lines 44, 51, 61, and 68.
- In the VB version, the bad calls are on lines 38, 47, 58, and 65.
- In the C++ version, the bad calls are on lines 12, 19, 30, and 37.
Please advise.
Contributor guide
Assessment
This issue has not been assessed yet.