Open gordonwatts opened 6 years ago
And another crash where we weren't able to find the files describing the local tev cluster.
Searching for all occurrences of CurrentDirectory...
What is interesting about the above crash is that the template file actually exists at that first location!
And the code couldn't be cleaner - or more immune to multi-threaded issues.
private string TemplateDirectory(string templateName)
{
var assDir = new FileInfo(Assembly.GetCallingAssembly().Location);
var assGuess = string.Format(@"{0}\Templates\{1}", assDir.DirectoryName, templateName);
if (File.Exists(assGuess))
return assGuess;
var assGuess1 = string.Format(@"{0}\{1}", assDir.DirectoryName, templateName);
if (File.Exists(assGuess1))
return assGuess1;
var guess = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\LINQToTTree\\Templates\\" + templateName;
if (File.Exists(guess))
return guess;
throw new FileNotFoundException($"Unable to locatoin LINQToTTree template file '{templateName}' in any standard location (tried '{assGuess}' and '{assGuess1}' and '{guess}'.");
}
Need to see this happen a little more often.
This is likely b.c. of the way we are doing our current directory (??).