I have an ASP.Net Core application, and for the current purposes I've got to use LocalAppData.
Usually I would write Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
, but unfortunately it's not working with ASP.Net Core.
Could anyone help me with this?
UPDATE
Thanks to Adem Caglin, I've found the solution.
The code I use:
Environment.GetEnvironmentVariable(
RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "LocalAppData" : "Home");
Try this:
Environment.GetEnvironmentVariable("LocalAppData");
ps: tested on windows
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With