jamesmontemagno / monkey-cache

Easily cache any data structure for a specific amount of time in any .NET application.
MIT License
670 stars 106 forks source link

(iOS) Could not find a part of the path - Exception #96

Closed AlleSchonWeg closed 2 years ago

AlleSchonWeg commented 3 years ago

Hi, on an iOS Simulator i get an exception with this code:

try {
     Barrel.ApplicationId = "yyyyy.zzzzz.iii";
     var barrel = Barrel.Current;
    } catch(Exception Ex) {
     var test = Ex.ToString();
    }

Could not find a part of the path '/Users/xxxxx/Library/Developer/CoreSimulator/Devices/6C0BE9F0-73AE-4FF0-BB7C-FF98823EC614/data/Containers/Data/Application/EEB796F3-AC4A-4E04-A20C-22589810A8D1/Library/Caches/yyyyy.zzzzz.iii/MonkeyCache'.

The Exception only occurs with iOS. Stacktrace:

at System.IO.FileSystem.CreateDirectory (System.String fullPath) [0x00187] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.IO.FileSystem/src/System/IO/FileSystem.Unix.cs:317 at System.IO.Directory.CreateDirectory (System.String path) [0x0002c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.IO.FileSystem/src/System/IO/Directory.cs:40 at MonkeyCache.SQLite.Barrel..ctor (System.String cacheDirectory) [0x0003b] in D:\a\1\s\src\MonkeyCache.SQLite\Barrel.cs:43 at MonkeyCache.SQLite.Barrel.get_Current () [0x00000] in D:\a\1\s\src\MonkeyCache.SQLite\Barrel.cs:31 at XXX..cctor () [0x0000d] in C:.............

Hmm, can you tell me what the problem is? The code above runs without problems on Android.

Thank you.

nor0x commented 2 years ago

it seems that iOS doesn't like values for AppliationId that contain a dot .

try using something like yyyyyzzzzziii for your ApplicationId