.NET MacOS Environment.SpecialFolder

This isn’t strictly a Rhino/Grasshopper issue, but I’m posting here as McNeel and Plugin developers might already be experiencing this and I haven’t found a solution elsewhere.
The Geometry Gym plugin does use environment folders such as Environment.SpecialFolder.CommonApplicationData to store and retrieve some files. This has worked well to date, but I’ve recently had a couple of mac users reach out and it seems this path is empty or not defined. Testing on my older mac book pro (in Rhino 8) it works fine.
But the user ran a version of this script, one exception observed relating to an invalid path for back up script (likely the same issue).
I haven’t found any resources on how a user might ensure these paths are valid.
Any suggestions or help will be gratefully received.

250130 app data paths.gh (15.1 KB)

Thanks,

Jon


Hi there, following Jon’s comments here’s my system info where I’m experiencing this issue
250130_ER.txt (4.8 KB)

Thanks a lot,
Looking forward to your kind reply,
very best,
Emmanuel

Hi @jonm
Microsoft’s System.Environment.SpecialFolder enum was not meant to be cross-platform equivalent, its purpose is to resolve the path on the targeted OS, windows.
(John Koerner - Special Folder Enum Values on Windows and Mac in .Net Core) bookmark this if you work on crossplatform plugins.
Hope this helps,
Farouk

1 Like