❔ Where to place files so my program can always find them?
Hey guys, I was working on one of my machines and my program is working fine. It has to open a csv file in a specific directory, and it does. But when I run it in visual studio, instead of looking in the root directory for the project, where all the files are, it looks "bin/Debug/netcoreapp6.0". How can I build my program so that these files are always in a set directory no matter the environment?
10 Replies
Hardcode an absolute path and not a relative one
instead of
Kinda thing
the issue I have is that my software should be completely portable
so hard coding a path is not a possibility i think
place them in somewhere like %AppData%?
but if you need it to be portable I think your best bet is to make it look from relative path
tbh your problem could be solved trivially by just copying the said required file to output on build
yeah something like that works too. Basically very similar to what I've suggested, which is %AppData%
but yeah, if this is just a static csv that is shipped with your program, slap it in the "copy to output"
will %appdata% work on linux?
😄
thx guys
that was helpful
ill look into the options i have
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.