Last post Apr 09, 2019 11:14 AM by mgebhard
Apr 09, 2019 08:58 AM|Shadow_Kittencorn|LINK
I am deploying an IIS asp.net core 2.2 website and I am having issues with how to store a JSON object.
I the moment I have a file called objects.json which is read using StreamReader. The problem is that when I build the project, the JSON file is combined with the rest and I can't edit it without rebuilding and redeploying the website.
What is the best way of doing this?
I have some environment variables, but I don't think that would be suitable for large json objects
Apr 09, 2019 11:14 AM|mgebhard|LINK
There is no reason why you can't edit a file and reload the file during run-time. It is just a matter of design and writing code to meet your requirements. It sounds like the object.json file is read once perhaps when the application starts.
Use a file listener that watches for changes. See the ASP.NET File Providers docs.