Ideally, I would make the report path a user setting and save it in whatever persistence mechanism you use so I do not have to find the files every time. I would also place checks to make sure no external tampering has been made to this directory.
If I just have to get this work:
File searches are always done in the current volume. You can actually set current volume for the application by changing it's current working directory. This should be done with utmost care as any other current directory related operations will be affected by this. With this out of way, if I just have to get it to work, I will do this:
var logicalDrives = System.IO.Directory.GetLogicalDrives();
Parallel.ForEach<string>(logicalDrives, (x) => { new ParallelSearcher { }.SearchFiles(x); });
And the search files would look like this:
public class ParallelSearcher
{
internal static ConcurrentBag<string> filePaths = new ConcurrentBag<string>();
internal void SearchFiles(string drive)
{
try
{
System.IO.Directory.SetCurrentDirectory(drive);
var results = System.IO.Directory.EnumerateFiles(@"..\ReportDesigner\Reports");
foreach (var result in results)
{
filePaths.Add(result);
}
}
catch (System.IO.DirectoryNotFoundException ex)
{
}
}
}