Reputation: 926
I was doing some Path.Combine stuff in a c# class and it was working previously. I've now moved my project to a tfs workspace and the codes broken in a couple of classes where I was using the Path.Combine method.
Here is the code that's breaking now :
string rootPath = Environment.CurrentDirectory;
string filePath = Path.Combine(rootPath,@"..\..\AdminAccount\User.txt");
private string[] getLines = System.IO.File.ReadAllLines(@filePath);
The error : The name 'Path' does not exist in the current context.
If someone could help me understand why this is happening so that I can prevent it from happening again.
A quick overview of my file paths so you can see exactly how I'm doing all these paths, although this may not be anything to do with the issue:
Upvotes: 1
Views: 1541
Reputation: 9499
string filePath = System.IO.Path.Combine(rootPath,@"..\..\AdminAccount\User.txt");
Upvotes: 6