Skip to content

Commit 56e89b4

Browse files
authored
Fix FileSystemInfo.Attributes exceptions (#3409)
The access denied exception has changed from ArgumentException on .NET Framework to UnauthorizedAccessException on .NET Core. See CoreFx issue #42076.
1 parent f0fbd18 commit 56e89b4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

xml/System.IO/FileSystemInfo.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,13 @@
274274
<exception cref="T:System.IO.FileNotFoundException">The specified file doesn't exist. Only thrown when setting the property value.</exception>
275275
<exception cref="T:System.IO.DirectoryNotFoundException">The specified path is invalid. For example, it's on an unmapped drive. Only thrown when setting the property value.</exception>
276276
<exception cref="T:System.Security.SecurityException">The caller doesn't have the required permission.</exception>
277+
<exception cref="T:System.UnauthorizedAccessException">.NET Core only: The user attempts to set an attribute value but doesn't have write permission.</exception>
278+
<exception cref="T:System.IO.PathTooLongException">The specified path, file name, or both exceed the system-defined maximum length.</exception>
277279
<exception cref="T:System.ArgumentException">The caller attempts to set an invalid file attribute.
278280

279281
-or-
280282

281-
The user attempts to set an attribute value but doesn't have write permission.</exception>
283+
.NET Framework only: The user attempts to set an attribute value but doesn't have write permission.</exception>
282284
<exception cref="T:System.IO.IOException">
283285
<see cref="M:System.IO.FileSystemInfo.Refresh" /> cannot initialize the data.</exception>
284286
<permission cref="T:System.Security.Permissions.FileIOPermission">for writing files and directories. Associated enumeration: <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Write" /> Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" /></permission>

0 commit comments

Comments
 (0)