[Mono-dev] Environment.GetFolderPath() behaviour inconsistent with .NET
Miguel de Icaza
miguel at xamarin.com
Thu Aug 18 16:00:47 EDT 2011
So is there a way to get a path to the Documents folder in OSX symbolically
> without hard-coding it?
Hard-code it, as it seems that OSX goes down the path of hardcoding HOME +
Documents as the directory, and then provides API to internationalize the
Looking briefly at the bug reports, it appears that the original .NET
> specification intended for that special folder enum to point to the
> Documents directory, not the user's home folder. So, and correct me if I am
> wrong, it does appear that the original implementation decision was not in
> line with the .NET specification.
It was when Mono was developed in 2001.
Nevertheless, I am not moving my application from Silverlight to Mono, I'm
> trying to develop an application that supports both simultaneously
> (something that it appears should be possible since one is supposed to be a
> superset of the other other).
I suggest you probe at runtime the system and decide the code path you take.
If Mono has a way of getting the Documents folder without hardcoding it, I'd
> be happy to use it in my specific application. I just don't want to end up
> in a situation where Mono decides to fix this in a future version and I end
> up getting a directory of the form //Users/Username/Documents/Documents/.
That is precisely the reason we are not going to change the existing
behavior, so existing code does not break.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-devel-list