dotnet-api-docs icon indicating copy to clipboard operation
dotnet-api-docs copied to clipboard

.NET FileSecurity documentation error

Open emmarker opened this issue 1 year ago • 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

emmarker avatar May 01 '24 22:05 emmarker

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 avatar May 06 '24 11:05 adamsitnik

@adamsitnik I can fix this - thanks.

gewarren avatar May 06 '24 21:05 gewarren