Search code examples
c#macosmonomonomac

Best way to obtain Mac ~/Library/ path when using C# with MonoMac


I have a shared codebase (dll) that I use for both a Windows and Mac project. I'm looking for the best (supported) way of obtaining the path to the Mac Library folder so my project honors the Mac App Store requirements.

Right now I'm using Environment.SpecialFolder.LocalApplicationData to get the path but that doesn't give me the correct folder.

Is anyone aware what I should use to get ~/Library/ ?


Solution

  • I didn't manage to find anything that mapped directly so I ended up coding the following:

    Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "Library")