4
Answers

C# Express 2008, relative project path not working

Ask a question
ssgrowntrunks

ssgrowntrunks

15y
6.6k
1
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)