You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: The original bug report, #30479, covered bothDirectoryInfo.MoveTo() and Directory.Move(), but the PR that was meant to fix the problem fixed Directory.Move() only.
See the linked report for conceptual background information.
Reproduction Steps
You can paste following snippet directly into a dotnet-script REPL and press Enter.
using System.IO;
Environment.CurrentDirectory = Path.GetTempPath();vardi= Directory.CreateDirectory("foo");// This should succeed even on macOS and Windows, but throws an exception.
di.MoveTo("FOO");
Expected behavior
Renaming should succeed, on all supported platforms.
Actual behavior
On Windows and macOS, the following exception is thrown:
System.IO.IOException: Source and destination path must be different.
Regression?
No response
Known Workarounds
Use the static Directory.Move() method instead.
Configuration
.NET 6.0.0-rtm.21522.10
Other information
No response
The text was updated successfully, but these errors were encountered:
Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.
Issue Details
Description
Note: The original bug report, #30479, covered bothDirectoryInfo.MoveTo() and Directory.Move(), but the PR that was meant to fix the problem fixed Directory.Move() only.
See the linked report for conceptual background information.
Reproduction Steps
You can paste following snippet directly into a dotnet-script REPL and press Enter.
using System.IO;
Environment.CurrentDirectory = Path.GetTempPath();vardi= Directory.CreateDirectory("foo");// This should succeed even on macOS and Windows, but throws an exception.
di.MoveTo("FOO");
Expected behavior
Renaming should succeed, on all supported platforms.
Actual behavior
On Windows and macOS, the following exception is thrown:
System.IO.IOException: Source and destination path must be different.
Description
Note: The original bug report, #30479, covered both
DirectoryInfo.MoveTo()
andDirectory.Move()
, but the PR that was meant to fix the problem fixedDirectory.Move()
only.See the linked report for conceptual background information.
Reproduction Steps
You can paste following snippet directly into a
dotnet-script
REPL and press Enter.Expected behavior
Renaming should succeed, on all supported platforms.
Actual behavior
On Windows and macOS, the following exception is thrown:
Regression?
No response
Known Workarounds
Use the static
Directory.Move()
method instead.Configuration
.NET 6.0.0-rtm.21522.10
Other information
No response
The text was updated successfully, but these errors were encountered: