Why not just assign a path directly from PlatformServices.Default.Application.ApplicationBasePath ? As the name implies, Default (not entirely correct, since Current also used here and there) is a static member of the PlatformServices type.
More at dept ...
In addition to Default , Application , which is of type ApplicationEnvironment , is the only property open class. And this is reasonable, because the ApplicationEnvironment simply encapsulates some information about the running application (or applications, no matter how much they may be). Importantly, the default ctor class is private . It smells like Singleton, huh ??
Obviously, the developers decided to change the view in the application environment: it does not serve anything, this is general information. The only way to use it is above.
And something else ...
IApplicationEnvironment magically disappeared, again, because it turned out that ApplicationEnvironment not a service that is expected to be modified or re-implemented for different operating systems and, possibly, from that moment, ApplicationEnvironment implements nothing. Very nice!
source share