.net 5 File.Create create file incorrect directory , path #2565
-
Describe the BugI try to create file in docker container. It can create. But create incorrect directory. When create in local(windows) it correct. Steps to ReproduceMy code to create file is
My Dockerfile just this .. ** I build+publish by command to target folder instead build in dockerfile. It build correct and can surf all feature that I have correct.
This image below is happen when I use command exec into docker container is running. -rw-r--r--. 1 root root 7.2K Jan 31 09:30 'app\wwwroot\xls_template\xlssave_31_01_2021___16_30.xlsx' this is my file is created. Other InformationOutput of
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It looks like this is an issue related to Windows and Linux using different path separators - |
Beta Was this translation helpful? Give feedback.
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.