dotnet/dotnet-api-docs

.NET FileSecurity documentation error

Opened this issue · 2 comments

The .NET 8 FileSecurity documentation has incorrect examples

This document recommends the use of SetAccessControl and GetAccessControl through the File class, which does not work in .NET 8
image

The example should be modified to use new FileInfo(fileName).SetAccessControl(fSecurity)

The reference links in the .NET 8 documentation also redirect to .NET Framework documentation, which is confusing for users.

image

image

Associated WorkItem - 261123

The example should be modified to use new FileInfo(fileName).SetAccessControl(fSecurity)

I agree. Would you like to send a PR with a fix?

The reference links in the .NET 8 documentation also redirect to .NET Framework documentation, which is confusing for users.

My guess it's because File.SetAccessControl and FileInfo.SetAccessControl don't exist in .NET (Core), but we provide extension methods for FileInfo:

image

image

@gewarren is it possible to customize the redirection for this API?

@adamsitnik I can fix this - thanks.