`Path.Combine`, `HasExtension`, `GetFileName` docs still describe .NET Framework volume-separator (`:`) handling
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- csharp
- Domain
- documentation
Research direction
Open xml/System.IO/Path.xml and find the documentation for the Combine, HasExtension, and GetFileName overloads named in the issue. Compare their remarks and return-value text with the modern behavior and the provided .NET Framework examples. Done means all affected wording describes current separator handling and identifies the volume-separator behavior as .NET Framework-specific.
Written by the indexing model from the issue text.
Description
Type of issue
Outdated article
Description
Several docs related to System.IO.Path APIs describe special handling of the volume separator (:) that modern .NET removed in .NET Core 2.1.
Path.Combine: the remarks for Combine(string, string), Combine(string, string, string), Combine(string, string, string, string) and Combine(params string[]) say a separator is appended only if the preceding path "is not a drive reference (that is, "C:" or "D:")" and does not end in DirectorySeparatorChar, AltDirectorySeparatorChar, or VolumeSeparatorChar. On .NET Core 2.1+ only DirectorySeparatorChar/AltDirectorySeparatorChar are checked, and no drive references:
| Call | .NET 10 | .NET Framework 4.x |
|---|---|---|
Path.Combine("C:", "foo") |
C:\foo |
C:foo |
Path.Combine("C:", "foo", "bar") |
C:\foo\bar |
C:foo\bar |
Path.Combine(new[] { "C:", "foo" }) |
C:\foo |
C:foo |
The fixed-arity overloads changed in dotnet/coreclr#15579, and the params string[] overload in dotnet/coreclr#16447. Discussion in dotnet/runtime#27535 confirms that the change was intentional.
The same PR, dotnet/coreclr#16447, has adjusted behavior of several other APIs in a similar manner (removed special treatment of :), invalidating some other remarks:
HasExtension(both overloads): return value and remarks say the search stops atVolumeSeparatorChar. It no longer does:Path.HasExtension(@"C:\a.b:c")istrueon .NET 10 andfalseon .NET Framework.GetFileName(both overloads): says the result is empty when the path ends in a volume separator. Only a drive root counts now:Path.GetFileName(@"C:\file.txt:stream")returnsfile.txt:streamon .NET 10 andstreamon .NET Framework;Path.GetFileName("foo:")returnsfoo:on .NET 10 and an empty string on .NET Framework. (The string overload's remarks already list onlyDirectorySeparatorChar/AltDirectorySeparatorChar, which contradicts its own return-value text.)
Proposal: describe the modern behavior (only DirectorySeparatorChar/AltDirectorySeparatorChar are treated as separators; a drive reference such as C: is still recognized at the start of a path, but not treated specifically by the affected APIs, e.g. Path.Combine). Add notes on the volume-separator behavior being specific .NET Framework only.
Page URL
Content source URL
https://github.com/dotnet/dotnet-api-docs-temp/blob/live/xml/System.IO/Path.xml
Document Version Independent Id
fe224bbb-0eec-28fe-93e4-80a25b795e62
Platform Id
3916d1a3-5b50-d6c3-65d1-d12ac54cc834
Article author
@dotnet-bot
- Dominant language
- C#
- Stars
- 954
- Forks
- 1.7k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 50
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/dotnet-api-docs
-
untriaged
Difficulty 1/5 Under an hour Newbie friendliness 95/100
dotnet/dotnet-api-docs#13122 ·
Maintainers usually reply within 1 day
-
UnscopedRefAttribute article displaying xml tagsPossibly taken @gewarren claimed this 5 days ago. Open:pushpin: seQUESTered untriaged
Difficulty 1/5 Under an hour Newbie friendliness 88/100
dotnet/dotnet-api-docs#13095 · 2 reactions · 2 assignees ·
Maintainers usually reply within 1 day
-
area-System.Threading untriaged
Difficulty 1/5 Under an hour Newbie friendliness 90/100
dotnet/dotnet-api-docs#13091 ·
Maintainers usually reply within 1 day
-
untriaged
Difficulty 1/5 Under an hour Newbie friendliness 88/100
dotnet/dotnet-api-docs#13039 · 1 comment ·
Maintainers usually reply within 1 day
-
DisplayAttribute string properties: Remarks incorrectly state the property performs resource lookupOpenarea-System.ComponentModel.DataAnnotations untriaged
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
dotnet/dotnet-api-docs#13023 · 1 comment ·
Maintainers usually reply within 1 day
All issues in dotnet/dotnet-api-docs
Similar issues
-
:watch: Not Triaged dotnet-target-version
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
copilot documentation
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
BHoM/MidasCivil_Toolkit#441 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day