Reputation: 930
I have a problem with localizing the JSON file inside my folder. I have a test class, and in the same directory, I have a JSON file. So what I want to achieve is to retrieve the JSON file with a relative path.
And the thing that I have tried is this
var jsonString = File.ReadAllText("\\TemplateUrlOk.json");
UPDATE
This is the structure of the test project.
Upvotes: 4
Views: 12925
Reputation: 930
I will be answering my question, hence I found the problem.
@ADyson mentioned that the JSON file needs to be copied in the directory when the project builds, which I did. However, it was in another folder called EmailController and the filename.
Upvotes: 1