Long paths in C#
By default, Windows uses a maximum length for paths that is 260 characters. This includes the drive letter – for example “C:\” – and the terminating null character. So this leaves you up to 256 characters for a path. This limitiation is defined due to the restrictions of the Windows API.
You can however use longer path names, that are up to 32767 characters. Within C#, there are serveral ways to achieve this:
- By adding
\\?\
in front of a path; - Using Windows 10 version 1067 or higher, updating the systems registry and your application manifest.
Posted in Uncategorized at January 30th, 2023. No Comments.