Skip to content

.net 5 File.Create create file incorrect directory , path #2565

Answered by MichaelSimons
uopeydel asked this question in Q&A
Discussion options

You must be logged in to vote

It looks like this is an issue related to Windows and Linux using different path separators - \ vs /. Linux does not detect \ as a valid path separator and therefore treats is as a character in the directory and file names. To make the app cross platform compatible, consider using Path.PathSeparator or Path.Combine to build up the paths.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MichaelSimons
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2560 on February 01, 2021 16:00.