I'm trying to deserialize a JSON file which is stored within a folder in my .NET windows forms project.
Deserialize from file:
private HashSet<string> swearWords = JsonConvert.DeserializeObject<HashSet<string>>(File.ReadAllText(Directory.GetCurrentDirectory() + @"\Folder\file.json"));
I get the error:
System.IO.DirectoryNotFoundException: 'Could not find a part of the path 'C:..\Prototypes\Prototype1\Prototype1\bin\Debug\Folder\file.json'.'
When i navigate to the Debug folder, it seems that my folder containing my json files is not there. The path is correct as far as I can see, but I don't think my json files are being added when the project builds.
The folder/files are included in the project.
How do I make sure that this folder I created is being included when the project is built?