Path to LocalAppData in ASP.Net Core application

Dmitry Volkov :

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");

adem caglin :

Try this:

Environment.GetEnvironmentVariable("LocalAppData");

ps: tested on windows

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

ASP.Net CoreアプリケーションのLocalAppDataへのパス

分類Dev

Localizable asp.net core + reactjs application

分類Dev

.NET application (WinForms) depending on ASP.NET Core server

分類Dev

Path based authentication in ASP.NET Core MVC 2.0

分類Dev

Generate dynamic route path in asp.net core

分類Dev

How to submit a file to an ASP.NET Core application

分類Dev

OpenCover for ASP.Net Core application running on IIS Express

分類Dev

ngrok and https tunnel for asp.net core application

分類Dev

How to handle multiple SPA application in ASP.NET Core

分類Dev

Run async code during startup in a ASP.Net Core application

分類Dev

.NET CoreとASP.NET Core

分類Dev

Azure WebApp Asp.NET Core 2 error: An error occurred while starting the application

分類Dev

How to host the basic ASP.NET Core 2 WebAPI application on IIS

分類Dev

HTTP Error 502.5 - Process Failure in ASP.NET Core 2.1 application

分類Dev

ASP.Net Core application service only listening to Port 5000 on Ubuntu

分類Dev

ASP.NET Core Fetch POST FormData()application / x-www-form-urlencoded

分類Dev

How to decrypt .AspNetCore.Identity.Application cookie in ASP.NET Core 3.0?

分類Dev

Download file from ASP.NET Core api from Blazor client application

分類Dev

ASP.Net Core Razor Pages application not binding to property within model

分類Dev

I'm getting an DirectoryNotFoundException error after published an blazor assembly application ASP.NET CORE hosted in IIS

分類Dev

Difference between using the ASP.NET Core Web Application (.NET Core) with net461 set as the only framework and using the (.NET Framework) template

分類Dev

Difference between using the ASP.NET Core Web Application (.NET Core) with net461 set as the only framework and using the (.NET Framework) template

分類Dev

In ASP.NET CORE application EF Core library do not return new inserted record's ID from database?

分類Dev

ASP.NET Core ToHtmlString

分類Dev

Cookieless ASP.NET Core

分類Dev

ASP.NET CoreのHttpRequest.PathとHttpRequest.PathBaseの違いは何ですか?

分類Dev

Changing Request Path in .Net Core 3.1

分類Dev

Application State (ASP.NET) または Singleton (ASP.NET Core) はどの程度安全ですか?

分類Dev

Path of home directory in asp.net

Related 関連記事

  1. 1

    ASP.Net CoreアプリケーションのLocalAppDataへのパス

  2. 2

    Localizable asp.net core + reactjs application

  3. 3

    .NET application (WinForms) depending on ASP.NET Core server

  4. 4

    Path based authentication in ASP.NET Core MVC 2.0

  5. 5

    Generate dynamic route path in asp.net core

  6. 6

    How to submit a file to an ASP.NET Core application

  7. 7

    OpenCover for ASP.Net Core application running on IIS Express

  8. 8

    ngrok and https tunnel for asp.net core application

  9. 9

    How to handle multiple SPA application in ASP.NET Core

  10. 10

    Run async code during startup in a ASP.Net Core application

  11. 11

    .NET CoreとASP.NET Core

  12. 12

    Azure WebApp Asp.NET Core 2 error: An error occurred while starting the application

  13. 13

    How to host the basic ASP.NET Core 2 WebAPI application on IIS

  14. 14

    HTTP Error 502.5 - Process Failure in ASP.NET Core 2.1 application

  15. 15

    ASP.Net Core application service only listening to Port 5000 on Ubuntu

  16. 16

    ASP.NET Core Fetch POST FormData()application / x-www-form-urlencoded

  17. 17

    How to decrypt .AspNetCore.Identity.Application cookie in ASP.NET Core 3.0?

  18. 18

    Download file from ASP.NET Core api from Blazor client application

  19. 19

    ASP.Net Core Razor Pages application not binding to property within model

  20. 20

    I'm getting an DirectoryNotFoundException error after published an blazor assembly application ASP.NET CORE hosted in IIS

  21. 21

    Difference between using the ASP.NET Core Web Application (.NET Core) with net461 set as the only framework and using the (.NET Framework) template

  22. 22

    Difference between using the ASP.NET Core Web Application (.NET Core) with net461 set as the only framework and using the (.NET Framework) template

  23. 23

    In ASP.NET CORE application EF Core library do not return new inserted record's ID from database?

  24. 24

    ASP.NET Core ToHtmlString

  25. 25

    Cookieless ASP.NET Core

  26. 26

    ASP.NET CoreのHttpRequest.PathとHttpRequest.PathBaseの違いは何ですか?

  27. 27

    Changing Request Path in .Net Core 3.1

  28. 28

    Application State (ASP.NET) または Singleton (ASP.NET Core) はどの程度安全ですか?

  29. 29

    Path of home directory in asp.net

ホットタグ

アーカイブ