langelescu
❔ How to deal with paths and file system files in a Win/Linux cross platform NET 6 application?
@OneWholesomeDev But in terms of maintaining sets of application-level configuration paths that are platform specific but accessing them through the same group of symbols, think almost like a Static class that resolves its paths at runtime. So I could invoke (for the purpose of this example) MyClass.LogsFolder anywhere this is used in the code and on Windows it would give me something like C:\User\AppData\MyApp\Logs and on Linux \usr\local\MyApp\Logs. You think this is a good idea?
17 replies
❔ How to deal with paths and file system files in a Win/Linux cross platform NET 6 application?
There's one catch. The hundreds of configuration files that are built into the system contain paths that are Windows specific. E.g. C:\This white space\Path\Is\Annoying. Is there something clever I can do to update these files such that the paths here can be used in both environments. Maybe I can use a sort of relative file path for the configuration and append that to platform specific locations, but not sure this is the way to go.
17 replies