Reputation: 715
I created txt file and added it to my solution in "Text" directory. I tried to read it using:
string[] lines = File.ReadAllLines("Text\t.txt");
but it says that there's not any file "Text\t.txt" in Debug directory. I want to have all files in solution. How can I solve it?
Upvotes: 0
Views: 113
Reputation: 25211
Right click on that file in the solution explorer and select Properties. Then make sure that Build Action
is set to None
and that Copy to output directory
is set to Copy Always
Also make sure that you escape the \
character:
string[] lines = File.ReadAllLines("Text\\t.txt");
Upvotes: 1