public IPersistentStorage GetStorage(Solution solution) { // check whether the solution actually exist on disk if (!File.Exists(solution.FilePath)) { return(NoOpPersistentStorageInstance); } // get working folder path string workingFolderPath; lock (getStorageLock) { workingFolderPath = TypeSystemService.GetCacheDirectory(solution.FilePath, true); if (workingFolderPath == null) { // we don't have place to save. don't use caching return(NoOpPersistentStorageInstance); } } return(GetStorage(solution, workingFolderPath)); }