Skip to content

The filename or extension is too long when creating a Directory on UNC #79

Description

@emilecastelnuovo

Using latest NuGet package: Pri.LongPath 2.0.47

When trying to create a Directory on a UNC path I get this error if the directory name contains an "extension" too long.
For example:
Directory.Create("\\sntsmb01\ApplicationSupport\Sviluppo\Deploy_Working\RIP_09733_ChangeManagement_PR_10125.IT_-20190426_01_Emile.Xxxxxxxxxxx\Cccccccccc\SmartClient\wwwroot_APPZ[SC] Cccccccccc.LimitsBuilder.2\Application Files\Xxxxxxx.Bre.Xxxxxx.Builder_4_5_0_214 ");

Workaround:
Create a fake Dir adding a fake extension like ".a" and then rename it using Directory.Move(fakeName, realName)

Stack Trace:
System.IO.PathTooLongException: The filename or extension is too long.

at Pri.LongPath.Directory.CreateDirectoryUnc(String path)
at Pri.LongPath.Directory.CreateDirectory(String path)

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions