It sounds like some type of exception is being thrown and causing the program to exit (perhaps the file location is incorrect).
You'll probably want to use a try-catch
block and wrap your ReadAllLines()
call so that you can capture the exception and see exactly what is going wrong :
try
{
File.ReadAllLines(yourPath)
}
catch(Exception ex)
{
// Place a breakpoint here to look at the exception
Console.WriteLine(ex.Message);
}
Try using the Visual Studio debugger to run your application in Debug mode to see if the exception message sheds any insight into your issue. You can also check the Event Viewer to see if any stack traces or other errors are present there as well.