Search code examples
asp.net-core.net-coreasp.net-core-2.1platform-independentfhs

Platform-independent directory


Does ASP.NET Core offer any platform-independent way to access standard paths, such as where data or configure files are supposed to be saved? Modules such as Qt's QStandardPaths are very helpful to prepare Qt applications to be deployed in a platform-independent way, but unfortunately I haven't found any similar service in ASP.NET Core. Does anyone know if anything like that exists in the .Net core or ASP.NET Core platforms?


Solution

  • You can use Environment.GetFolderPath.

    This blog post provides more info on how the API behaves cross-platform.