Backstory:
I can get an output from a json I need to set the json manually to "Copy always" under "Copy to Output Directory"; is there any way I can automatically do this?
Because I spent like 15 minutes trying to figure out why I'm not getting any output, so doing this step automatically would cause less head-aches :D
Some of my code where I would like to implement it
static Config()
{
if (!Directory.Exists(configFolder))
{
Directory.CreateDirectory(configFolder);
}
if(!File.Exists(path))
{
bot = new BotConfig();
string json = JsonConvert.SerializeObject(bot, Formatting.Indented);
File.WriteAllText(path, json);
}
else
{
string json = File.ReadAllText(path);
bot = JsonConvert.DeserializeObject<BotConfig>(json);
if (bot.token == null)
{
Console.WriteLine("Could not optain bot.token from {0}", path);
}
}
}
I hope this make sense, I couldn't find anything related to this.