Skip to content

Incorrect exception list in Path.GetFullPath documentation #13359

Open

Description

@dovydenkovas

Type of issue

Outdated article

Description

GetFullPath doesn't actually throw a PathTooLongException or SecurityException.
I initially opened a PR to add a length check, but as discussed there is no reliable way to validate a path before making a syscall, since the limits could be different on different filesystems and OS configurations.

I would like to update the XML documentation for Path.GetFullPath to reflect the actual behavior.

Page URL

https://learn.microsoft.com/en-us/dotnet/api/system.io.path.getfullpath?view=net-10.0

Content source URL

https://github.com/dotnet/dotnet-api-docs-temp/blob/live/xml/System.IO/Path.xml

Document Version Independent Id

d219c9d5-857a-0de1-ac97-32e2407bd801

Platform Id

45e4d728-21c9-9e62-68db-cda1c44467ca

Article author

@dotnet-bot

Activity

  1. dovydenkovas commented on Nov 18, 2026

    @dovydenkovas
    Author

    Additionally, there are several related methods that call GetFullPath and inherit PathTooLongException or SecurityException in their documentation from it without actually performing those checks:

    • FileInfo(string fileName) and DirectoryInfo(string path) constructors.
    • Directory.GetParent(string path), Directory.GetDirectoryRoot(string path), Path.GetRelativePath(string relativeTo, string path).

    I could update the documentation for these APIs as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions