First, can you post your config file? Are you sure that there is an app setting called 'FiletextPath'
Next, break down this line into two
string[] lineOfContents = File.ReadAllLines(ConfigurationManager.AppSettings["FiletextPath"]);
so that it becomes
var path = ConfigurationManager.AppSettings["FiletextPath"]
string[] lineOfContents = File.ReadAllLines(path);
Then see which line throws the error.