private static string GetDbRootFolder()
{
string assemblyLocation = Assembly.GetExecutingAssembly().Location;
string rootFolder = Path.GetDirectoryName(assemblyLocation);
Debug.Assert(rootFolder != null);
do
{
string dbRootFolder = Path.Combine(rootFolder, "Databases");
if (Directory.Exists(dbRootFolder))
{
return dbRootFolder;
}
rootFolder = Path.GetDirectoryName(rootFolder);
} while (rootFolder != null);
throw new InvalidOperationException("Failed to find 'Databases' folder.");
}