[Breaking change]: InMemoryDirectoryInfo now prepends rootDir to the files instead of CWD #39189
Closed
1 of 3 tasks
Labels
breaking-change
Indicates a .NET Core breaking change
🏁 Release: .NET 9
Work items for the .NET 9 release
doc-idea
Indicates issues that are suggestions for new topics [org][type][category]
in-pr
This issue will be closed (fixed) by an active pull request.
Pri1
High priority, do before Pri2 and Pri3
📌 seQUESTered
Identifies that an issue has been imported into Quest.
Description
InMemoryDirectoryInfo
now prependsrootDir
to thefiles
.InMemoryDirectoryInfo
is used byMatcherExtensions.Match
which enables theMatcher
to execute glob matching patterns without hitting disk.This new behavior was already stated in the documentation, but it was not happening in practice.
Version
.NET 8 GA
Previous behavior
Before .NET 9, relative paths in
files
were prepending the CWD, this caused an unnecessary dependency on the CWD for a type that is supposed to work in-memory.New behavior
Now, relative paths in
files
will be prepended withrootDir
as described in the documentation.Type of breaking change
Reason for change
There were blocked scenarios with in-memory paths using a drive letter other than the one used by the CWD, see dotnet/runtime#93107 for an example.
Recommended action
Users depending on the previous behavior must adjust their code to account for the files now being prepended with
rootDir
in a similar way to the following:Feature area
Core .NET libraries
Affected APIs
Associated WorkItem - 206387
The text was updated successfully, but these errors were encountered: