I have an ASP.NET Core (1.0-rc1-final) MVC solution and I wish to store a simple text file within the project which contain a list of strings which I read into a string array in my controller.
Where should I store this file in my project and how do I read those files in my controllers?
In ASP.net 4.x I'd have used the app_data
folder and done something like this
string path = Server.MapPath("~/App_Data/File.txt");
string[] lines = System.IO.File.ReadAllLines(path);
But Server.MapPath
does not seem to be valid in ASP.Net Core 1 and I'm not sure that the app_data
folder is either.