I have some JSON data-configuration files that I wish to have them online as static files and read them upon my web-service initialization. So, I wish to access them internally from my code, not to make them public to external access.
Following the instructions (below) I placed them inside a /wwwroot/Static folder and used app.UseStaticFiles(); in Startup.Configure(), then I try to read them via both HTML and C# code using the "~/Static/*.json" notation but it does not work from C# code.
- instructions reference: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/static-files?view=aspnetcore-3.1
When locally, I am getting error: DirectoryNotFoundException: Could not find a part of the path '...\Repos\VS2019\my-project-folder\~\Static\filename.json'.
So, the ~ symbol is not translated to wwwroot folder name.
When online (as Azure App Service) I am getting: HTTP ERROR 500
What I have done wrong?