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
I'm getting inconsistent results when calling Directory.CreateDirectory in a .NETCoreApp 1.0 and 2.0 compared to .NETFramework 4.6.2.
If the folder ends with a whitespace but doesn't contain any whitespaces in the name: Directory.CreateDirectory("c:\work\CreateDirectory\folder \inner") Directory.CreateDirectory("c:\work\CreateDirectory\ folder \inner")
will throw an exception:
at System.IO.Win32FileSystem.CreateDirectory(String fullPath)
at System.IO.Directory.CreateDirectory(String path)
at TrailingNETCore.Program.ValidateCreate(String path, String netFrameworkResult) in C:\source\TrailingWhiteSpace\TrailingWhiteSpace\TrailingNETCore\Program.cs:line 55
If the folder ends with a whitespace but contains whitespaces in the name: Directory.CreateDirectory("c:\work\CreateDirectory\fold er \inner") Directory.CreateDirectory("c:\work\CreateDirectory\ fol der \inner")
will get different results than .NETFramework.
I attached an example program with various use cases and a comparison against .NETFramework CreateDirectory.zip
The text was updated successfully, but these errors were encountered:
You cannot create a file or directory name that has trailing spaces or periods without using \\?\ at the beginning of the path. If you see that not working please reactivate. We explicitly do not want to support creating such paths without the syntax (e.g. adding it implicitly) as most apps can't handle it.
I'm getting inconsistent results when calling Directory.CreateDirectory in a .NETCoreApp 1.0 and 2.0 compared to .NETFramework 4.6.2.
If the folder ends with a whitespace but doesn't contain any whitespaces in the name:
Directory.CreateDirectory("c:\work\CreateDirectory\folder \inner") Directory.CreateDirectory("c:\work\CreateDirectory\ folder \inner")
will throw an exception:
at System.IO.Win32FileSystem.CreateDirectory(String fullPath)
at System.IO.Directory.CreateDirectory(String path)
at TrailingNETCore.Program.ValidateCreate(String path, String netFrameworkResult) in C:\source\TrailingWhiteSpace\TrailingWhiteSpace\TrailingNETCore\Program.cs:line 55
If the folder ends with a whitespace but contains whitespaces in the name:
Directory.CreateDirectory("c:\work\CreateDirectory\fold er \inner") Directory.CreateDirectory("c:\work\CreateDirectory\ fol der \inner")
will get different results than .NETFramework.
I attached an example program with various use cases and a comparison against .NETFramework
CreateDirectory.zip
The text was updated successfully, but these errors were encountered: