C# Express 2008, relative project path not working

Jul 26 2009 11:46 PM
I added a simple text file to my project. But when I try to read from it, an error says it can't find the file. The file is called 'Exes.txt'. What I tried is : string s = System.IO.File.ReadAllText("Exes.txt")); when debugging it looks in [projectfolder]/bin/debug/, when not debugging it looks in [projectfolder]/bin/release/. The file is at [projectfolder]. How can I access the file with a relative path?

Answers (4)