❔ Pathing error issue in forms app, only on Linux
Hey! So i have this issue currently which i've been somewhat mindboggled over , basically all this function does is grab folders from that defined directory and spit their names right into a combobox, it works completely fine on windows. i usually like to have my app working on both linux and windows and ive ran into this error on Linux with my app that says "/n/n Invalid path", i had a thought that it might be due to this path thats defined here ORIGINALLY using backslashes because i've heard in the past that linux does not fare well with backslashes in paths. i use / now and it still errors, i tried defining the Working Directory next to the written path as thats what i thought might be needed incase linux/proton is just being picky. still errors, any ideas on what could be causing it would be gladly appreciated, thank you!
24 Replies
I know its due to this function because commenting it out when its loaded makes my app work completely fine
You're trying to get a Windows forms app to work on Linux...?
Wine maybe?
Are you using correct case in path (Linux is case sensitive)?
Wine/Proton, im just trying to make sure it works on that aswell as windows, painfully
it should be the correct case, which is also confusing me
its the same on linux aswell, for the folders
I have some idea what could it be
print WADPathExtension and DATPathExtension values
Because it could have missing path separator
In Linux directory paths does not have separator (/) at end
It will work under mono natively, but Avalonia/ETO.Forms is better solution
i'm thinking it might not work because the implementation of
System.IO
may be windows-centric on this version?
oh wait you can make winforms apps on .net 7 rightwait a minute im confused
I checked and in mono, aswell as in .net core it returns the same values
im gonna try something real quick
its printing without "/" between path and "tracks"
for some reason
But with mono it's some sort of true, for example it's funny how mono emulates registry on Unix systems
In Linux directory paths does not have separator (/) at end
also where is that
data
directory located?
can't be in root right
if it's relative to the working directory, then you want to use ./data/...
but what about paths like this? should this error in linux?
somewhat updated code
data directory is located in the same folder as the application
ok we have some big issues here
what does that foreach loop do exactly?
@uzis?
I was thinking similar
grabs these paths
you always want to use
Path.Join
(Path.Combine
on older .net versions) if you're working with multiple operating systems
you could (maybe should) be Debug.WriteLine
ing Path.GetFullPath(wad)
insteadSolved it, this helped alot thank you!
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.