I have a Visual Studio c# project with the following structure:
SolutionFolder
|-Folder1
|- Project1
|- TestProject1
|-Folder2
|- Project2
|- TestProject2
|-TaskFolder
|-file
...etc
One of the pipeline Tasks creates a folder under SolutionFolder and writes a file in it. (i.e. TaskFolder/File)
When the Testprojects are running I want to read this file. I'm calling GetCurrentDirectory in the code and in my machine this returns the Parent of the TestProject folder. i.e (Folder1) I can then go to the parent (i.e SolutionFolder) and to the file in question. TaskFolder/File
However When this runs in the Pipeline GetCurrentDirectory returns a/1 and the parent being a. so I have to add 1/s/SolutionFolder/TaskFolder/File to get to the file.
IS there a way to get a folder starting point that works for the MsAgent and the local machine. i.e (Get SolutionFolder) then /TaskFolder/File. so that the code is the same when running under each of these environments?
P.S. When running locally the File is expected to be manually place in the /TaskFolder/File as this is mainly for debugging.
Thanks in advance.