Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`Path.Combine`, `HasExtension`, `GetFileName` docs still describe .NET Framework volume-separator (`:`) handling

Open Beginner friendly
#13,124 0 comments 0 reactions 0 assignees View on GitHub

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

untriaged
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 at VolumeSeparatorChar. It no longer does: Path.HasExtension(@"C:\a.b:c") is true on .NET 10 and false on .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") returns file.txt:stream on .NET 10 and stream on .NET Framework; Path.GetFileName("foo:") returns foo: on .NET 10 and an empty string on .NET Framework. (The string overload's remarks already list only DirectorySeparatorChar/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

https://learn.microsoft.com/en-us/dotnet/api/system.io.path.combine?view=net-10.0#system-io-path-combine(system-string-system-string)

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/dotnet-api-docs

All issues in dotnet/dotnet-api-docs

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.