Uri recognition of UNC paths on Unix
The Uri class now recognizes strings that start with two forward slashes (
//) as universal naming convention (UNC) paths on Unix operating systems. This change makes the behavior for such strings consistent across all platforms.
In previous versions of .NET, the Uri class recognizes strings that start with two forward slashes, for example,
//contoso, as absolute file paths on Unix operating systems. However, on Windows, such strings are recognized as UNC paths.
Starting in .NET 5, the Uri class recognizes strings that start with two forward slashes as UNC paths on all platforms, including Unix. In addition, properties behave according to UNC semantics:
- Uri.IsUnc returns
- Backslashes in the path are replaced with forward slashes. For example,
- Uri.LocalPath doesn't percent-encode characters. For example,
//first/\uFFF0is not converted to
No action is required on the part of the developer.